-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to track order of attributes and fields #82
Conversation
There is currently no way to determine if |
It seems like checking if order tracking is enabled in the creation property list is not an immediate need - I will merge this as-is shortly and make a new release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Module.open()
is going to be super useful, thanks!
src/hdf5_util.cc
Outdated
@@ -27,6 +27,31 @@ EM_JS(void, throw_error, (const char *string_error), { | |||
// // pass | |||
// } | |||
|
|||
int64_t open(const std::string& filename_string, unsigned int h5_mode, bool track_order = false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could H5F_ACC_RDONLY
be the default for h5_mode
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure!
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)
Also adds one method to the Module API:
open(filename: string, mode: number, track_order: boolean): bigint;
and modifies the signatures of three existing methods in the Module API:
create_dataset
create_group
create_vlen_str_dataset