- all datasets and attributes are read out in little-endian order (closes #49)
- New method to overwrite slice of an existing dataset:
Dataset.write_slice(ranges: Array<Array<number>>, data: any): void;
- Method to delete an attribute from a dataset or group (can be used to update an attribute by deleting it then re-creating it)
Dataset.delete_attribute(name: str): number
(returns non-zero value if it fails for some reason)Group.delete_attribute(name: str): number
- Ability to specify chunks and maxshape when creating dataset (to make a resizable dataset):
Group.create_dataset(name: string, data: GuessableDataTypes, shape?: number[] | null, dtype?: string | null, maxshape?: (number | null)[] | null, chunks?: number[] | null): Dataset
- New method to resize datasets (only works if chunks and maxshape were defined):
Dataset.resize(new_shape: number[]): void
- Metadata now includes
chunks: Array<number> | null,
information andmaxshape: Array<number> | null
- Group.paths(): string[]; // returns a list of all link paths found below the group in the tree. (Use on root object to get all paths in the file)
- Group.create_soft_link(target: string, name: string): number; // creates a soft link in a group with name: name (target must be absolute path)
- Group.create_hard_link(target:string, name: string): number; //
- Group.create_external_link(file_name: string, target: string, name: string): number;
All of these return non-zero values on error. To create links with absolute path, just use e.g. File.create_soft_link(target_path, link_path);
- IIFE build at
./dist/iife/h5wasm.js
, to support use in Firefox workers (which don't currently support ESM) - WORKERFS support in ESM/IIFE builds, for loading local files with random access instead of copying whole file into memory
- basic support for reading datatypes from files (see PR #34)
- basic filter information made available (see PR #35)
- removed
Dataset.auto_refresh
and replaced with.refresh()
method (allows consistent access to metadata and data between refreshes)
- H5Create should only be called with access modes H5F_ACC_TRUNC (w) and H5F_ACC_EXCL (x)
- support for SWMR read with refresh on a dataset: e.g.
const file = new hdf5.File("swmr.h5", "Sr");
let ds=file.get("data");
ds.auto_refresh=true;
ds.shape;
// returns 12
ds.shape;
// returns 16 because dataset was updated with SWMR write
ds.value
// has size=16
- error in
isIterable
when called on non-object (affectsto_array
method)
to_array
method on Dataset and Attribute classes: returns nested array of values with dimensions matchingshape
. Auto-converts all values to JSON-compatible types (BigInt -> Number, TypedArray -> Array)- auto-convert h5py-style boolean datasets (where datatype = ENUM {FALSE:0, TRUE:1}) to JS booleans
- automated testing of code with Github Action
- enum_type.members is now an object {[name: string]: value: number} (previous implementation with Array could have wrong name order)
- extended metadata for ENUM type (including names of members)
- Typings for metadata on attributes and datasets
- Minimal handling of reading datatype H5T_ENUM (treats as integer base type)
- All strings now truncated at first null byte before decoding
- Fixed memory leaks from opening dtype and plist objects
- Singleton values (shape = []) were being returned as length-1 array due to logic error, now fixed
- POSSIBLY BREAKING: nodejs target is compiled as ESM instead of CommonJs
- default export is now an object, which can help when
import *
is discouragedexport const h5wasm = { File, Group, Dataset, ready, ACCESS_MODES } export default h5wasm;
ready
export now returnsPromise<H5Module>
- recommended access to filesystem is by
const { FS } = await h5wasm.ready;
- VLEN string writing and reading test
- TypeScript types added for Attribute
- Full metadata added to Attribute in addition to dtype and shape
- TypeScript
strict
mode checking enabled for build - all TypeScript type errors resolved
- unused portions of the
EmscriptenModule
interface that raise errors in nodejs builds are removed (both of these depend on dom definitions)- preinitializedWebGLContext: WebGLRenderingContext;
- onCustomMessage(event: MessageEvent): void;
Group.get_type(path)
will now returnH5G_LINK (3)
if path is a dangling soft linkH5G_UDLINK (4)
if path is a user-defined (e.g. external) link
Group.get(path)
will now returnBrokenSoftLink(target: string)
if the path is a dangling soft linkExternalLink(filename: string, obj_path: string)
if the path is an external linkundefined
if the path is a user-defined link that is not an external link.
- compiled with
-s SINGLE_FILE
to embed WASM in output .js file (for compatibility with bundlers) - using external build of libhdf5 from https://github.com/usnistgov/libhdf5-wasm
- IDBFS adapter added to ESM module
- license statement expanded
- Writing of Float64 datasets was broken, and is now working
- Guessed shape of simple string values is fixed so that this will work:
f.create_attribute("my_attr", "a string value");
- Group.prototype.create_dataset now returns type Dataset (ts)
- Typescript definitions (src/hdf5_hl.d.ts)
- Support for reading and processing HDF5 Array datatype
- esm and nodejs modules both offer
ready
Promise, which can be awaited before working with the module (addresses #5) - minimal set of tests (
npm test
)
- POSSIBLY BREAKING: local paths to modules are changed
- esm: ./dist/esm/hdf5_hl.js
- node (CJS): ./dist/node/hdf5_hl.js
- Build step added (esm and nodejs modules both built from Typescript source)
- Build artifacts no longer available from
dist
branch, will be uploaded as .tgz archive (output of npm pack) to releases
- auto decoding of Compound datatypes to native Javascript arrays
- ESM build targets web environment (no 'require' statements - fixes builds using webpack e.g. create-react-app)
- emscripten build script altered to work on OSX as well as linux (compatible call to shasum)
- minor bugfix in string reading ('metadata' spelled wrong)
- export AsciiToString and UTF8ToString from emscripten
- support reading vlen strings in data and attributes
- support writing vlen strings
- reclaim memory for vlen data in get_attr
- added documentation for finding libhdf5.a
- documentation for creating new File object in nodejs
- checking for name existing before getting type in wasm lib
- download/upload helpers for web (file_handlers.js)
- use ZLIB from emscripten ports