Skip to content

Releases: usnistgov/h5wasm

v0.7.8

06 Sep 20:01
Compare
Choose a tag to compare

v0.7.8 2024-09-06

Added

  • Add close_file method to Module API: close_file(file_id: bigint): number;

Fixed

  • Fix accessing attributes of committed datatype with my_datafile.attrs.
  • Fix calling get_attribute_names method of Module API on committed datatype.

Changed

  • Mark optional parameters as such in the TypeScript declarations of the following H5Module methods: open, create_dataset, create_group, create_vlen_str_dataset and get_keys_vector.

v0.7.7

28 Aug 16:26
Compare
Choose a tag to compare

v0.7.7 2024-08-28

Added

  • A method to read metadata from committed datatypes in an HDF5 file

    • Datatype.metadata is a getter that returns the dtype metadata, in the same format (Metadata TypeScript interface) returned from Dataset.metadata
  • Enable "track order" mode of HDF5 for attributes of Dataset, and (fields and attributes) of Group. When track_order == true for a Group, both fields and attributes keep their insertion order on read. For a Dataset, the attributes keep their insertion order when the flag is set.

    Note that the flag is not inherited, i.e. if an h5wasm.Group object is created with track_order = true, its sub-groups and contained Dataset objects will not have the flag enabled by default. The flag is added to the File constructor just to track order of immediate children of the root group.

    Changes three signatures in the h5wasm API:

    • h5wasm.File(filename: string, mode: ACCESS_MODESTRING = "r", track_order: boolean = false)
    • h5wasm.Group.create_group(name: string, track_order: boolean = false)
    • h5wasm.Group.create_dataset(args: {
        name: string,
        data: GuessableDataTypes,
        shape?: number[] | null,
        dtype?: string | null,
        maxshape?: (number | null)[] | null,
        chunks?: number[] | null,
        compression?: (number | 'gzip'),
        compression_opts?: number | number[],
        track_order?: boolean,
      })
      

    Also adds one method to the Module API:

    • open(filename: string, mode?: number, track_order?: boolean): bigint;
      (the default arguments are mode = H5F_ACC_RDONLY and track_order = false)

    and modifies the signatures of three existing methods in the Module API:

    • create_dataset
    • create_group
    • create_vlen_str_dataset

v0.7.6

06 Aug 16:14
Compare
Choose a tag to compare

v0.7.6 2024-08-06

Added

  • Full support for reading VLEN datasets (numeric variable-length datasets), fixing #78

    • previously the library made no attempt to read the stored values and returned the raw bytes (corresponding to intermediate[length, data_pointer] pairs)
    • now returns an Array of TypedArray objects containing the stored values (or an Array of Array objects if json_value is requested)
    • vlen_type?: Metadata key added to Metadata interface, and populated with type information about the base type in a VLEN dataset

Changed

  • Retrieve value of boolean dataset as Int8Array instead of plain JS boolean array. To retrieve a plain JS boolean array, use json_value instead:

    // v0.7.5 and earlier
    bool_dset.value; // -> [false, true]
    bool_dset.json_value; // -> [false, true]
    
    // v0.7.6 onwards
    bool_dset.value; // -> Int8Array(2) [0, 1]
    bool_dset.json_value; // -> [false, true]

v0.7.5

03 Jun 14:56
Compare
Choose a tag to compare

v0.7.5 2024-06-03

Added

  • added virtual_sources?: { file_name: string, dset_name: string } to Dataset.metadata when dataset is virtual.
  • added strpad enum to metadata (type of string padding) - PR #72 @axelboc

v0.7.4

03 Apr 15:03
Compare
Choose a tag to compare

v0.7.4 2024-04-03

Fixed

  • added missing .js extension in type imports
    ( see issue comment #31 (comment) and fix in #71 )

v0.7.2

29 Feb 16:31
Compare
Choose a tag to compare

v0.7.2 2024-02-29

Added

  • new optional HDF5 error handler that throws Javascript error (old handler printed HDF5-DIAG error strings using console.error(), but did not throw a JS Error)
  • when activated, the thrown Error.message is the same string that was previously printed to the console

To enable:

const Module = await h5wasm.ready;
Module.activate_throwing_error_handler();
// to deactivate, restoring console.error behavior:
// Module.deactivate_throwing_error_handler();

v0.7.1

18 Dec 14:48
Compare
Choose a tag to compare

v0.7.1 2023-12-18

Added

  • Support for object and region references (#65)
    • create object reference with Dataset.create_reference() or Group.create_reference()
    • dereference against any object in the same file or the root File object with e.g. obj = File.dereference(ref)
    • create region references with Dataset.create_region_reference([[start_axis_0, end_axis_0, step_axis_0], [start_axis_1, ...], ...])
    • retrieve values of region reference with File.dereference(region_ref)
    • store references in a dataset using dtype='Reference' or dtype='RegionReference' or if data is an array of references, it will be guessed
    • retrieve references from dataset using slice or value as usual, and dereference as above.

v0.7.0

05 Dec 17:13
Compare
Choose a tag to compare

v0.7.0 2023-12-05

Changed

  • package.json modified so that exports are defined in a way that works better with bundlers
    • (should now work with e.g. NextJS)
  • Breaking change the nodejs import is now 'h5wasm/node' rather than 'h5wasm'. The nodejs examples in the README have been updated, as well as the tests.
  • tests modified to use smaller compressed array (reduce package size)

v0.6.10

09 Nov 16:23
Compare
Choose a tag to compare

v0.6.10 2023-11-09

Added

  • export more symbols to support blosc2 filter

v0.6.9

06 Nov 17:20
Compare
Choose a tag to compare

v0.6.9 2023-11-06

Fixed

  • added missing FileSystem API function mkdirTree to Emscripten typescript interface

Added

  • Functions for working with dimension scales in typescript interface:
// convert dataset to dimension scale:
Dataset.make_scale(scale_name: string)
// attach a dimension scale to the "index" dimension of this dataset:   
Dataset.attach_scale(index: number, scale_dset_path: string)
// detach a dimension scale from "index" dimension
Dataset.detach_scale(index: number, scale_dset_path: string)
// get full paths to all datasets that are attached as dimension scales
// to the specified dimension (at "index") of this dataset:
Dataset.get_attached_scales(index: number)
// if this dataset is a dimension scale, returns name as string
// (returns empty string if no name defined, but it is a dimension scale)
// else returns null if it is not set as a dimension scale:
Dataset.get_scale_name()
  • Functions for working with dimension labels (not related to dimension scales)
// label dimension at "index" of this dataset with string "label":
Dataset.set_dimension_label(index: number, label: string)
// fetch labels for all dimensions of this dataset (null if label not defined):
Dataset.get_dimension_labels()