-
Notifications
You must be signed in to change notification settings - Fork 12
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
Don't convert boolean enums unless JSON compatibility is requested #76
Conversation
Sorry for the spam, I'm struggling to run the tests locally. Also, the typed array returned by HDF5 lib depends on the enum type's underlying |
To run tests locally, you can use a conda environment (specifically using conda-forge):
the emscripten compile will be a little slow the first time, because it's compiling and caching a bunch of system libraries. |
For your changes in this PR, you will only need to run |
Thanks, what's weird is that I already have a working environment that allows me to run
The files do exist, obviously, so not sure what's going on. |
Ah all good, I had made changes to |
Is this one ready for review? |
Yep, sorry :) |
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.
Since I think your team requested the conversion to boolean in the first place, I'm happy to make this subtle change; if you wouldn't mind adding a note to the CHANGELOG.md indicating the new behavior I'd appreciate it. (feel free to add a section for v0.7.6 - we can change the version number later if breaking metadata changes are included into something like v0.8.0)
No worries, done! |
H5Web supports plotting boolean datasets:
Currently, h5wasm converts boolean enum arrays, which are read as numeric typed arrays by the HDF5 library, to plain JS boolean arrays. This means that in H5Web, I have to convert those boolean arrays back to numeric arrays before I can plot them.
In this PR, I'm proposing to no longer convert boolean enum arrays when
json_compatible
isfalse
- i.e. to convert them only when JSON-compatible data is requested.