Releases: usnistgov/h5wasm
v0.7.8
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
andget_keys_vector
.
v0.7.7
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 fromDataset.metadata
-
Enable "track order" mode of HDF5 for attributes of
Dataset
, and (fields and attributes) ofGroup
. Whentrack_order == true
for aGroup
, both fields and attributes keep their insertion order on read. For aDataset
, 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 withtrack_order = true
, its sub-groups and containedDataset
objects will not have the flag enabled by default. The flag is added to theFile
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 aremode = H5F_ACC_RDONLY
andtrack_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
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
ofTypedArray
objects containing the stored values (or anArray
ofArray
objects ifjson_value
is requested) vlen_type?: Metadata
key added toMetadata
interface, and populated with type information about the base type in a VLEN dataset
- previously the library made no attempt to read the stored values and returned the raw bytes (corresponding to intermediate
Changed
-
Retrieve
value
of boolean dataset asInt8Array
instead of plain JS boolean array. To retrieve a plain JS boolean array, usejson_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
v0.7.4
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
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 JSError
) - 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
v0.7.1 2023-12-18
Added
- Support for object and region references (#65)
- create object reference with
Dataset.create_reference()
orGroup.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'
ordtype='RegionReference'
or if data is an array of references, it will be guessed - retrieve references from dataset using
slice
orvalue
as usual, and dereference as above.
- create object reference with
v0.7.0
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'. Thenodejs
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
v0.6.10 2023-11-09
Added
- export more symbols to support
blosc2
filter
v0.6.9
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()