-
Notifications
You must be signed in to change notification settings - Fork 6
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
[Feature]: Write zarr without using pickle #171
Comments
Thanks for the suggestion. I think this means updating the calls to |
@magland is this something you are interested in helping with by contributing a PR or would you like us to take a look at this? |
@oruebel I am happy to create a PR, but I will need some help knowing what to change. Now that you pointed to
and
That should give me something to go on. I'll working on putting something together for you to look at. |
Great! Thanks for the help! A first test could be to just set the hdmf-zarr/src/hdmf_zarr/backend.py Line 124 in 556ed12
I think there may be a couple of places where the hdmf-zarr/src/hdmf_zarr/backend.py Line 1272 in 556ed12
hdmf-zarr/src/hdmf_zarr/backend.py Line 1312 in 556ed12
In addition to datasets, another place where encoding could potentially come up is when writing attributes. I don't think this should be an issue, because a) Zarr stores attributes in JSON, and b) I don't think NWB stores objects in attributes. However, I wanted to mention it just in case. If attribute encoding should come up as an issue, those are written here: hdmf-zarr/src/hdmf_zarr/backend.py Line 558 in 556ed12
|
Thanks @oruebel I tried out changing the default codec class in ZarrIO to numcodecs.JSON as you suggested, and indeed that worked! At least for the dataset I tested. I'll make a PR and we'll see if it passes the tests. |
What would you like to see added to HDMF-ZARR?
I was working on adding nwb-zarr support to neurosift and I ran into a problem where many of the datasets within the zarr were pickle-encoded. It is difficult to read pickled data in languages other than Python, and it is practically impossible using JavaScript in the browser. So I would like to request that hdmf-zarr be updated to avoid using pickling when writing datasets.
Is your feature request related to a problem?
No response
What solution would you like?
@bendichter and I created a script for doing the h5->zarr conversion without using pickle:
https://gist.github.com/magland/39c5c5c5afabb982b5dd5d2367f2179b
and we confirmed that it (a) the output is loadable in hdmf-zarr and (b) it works with Neurosift
We have only tried it on the one nwb file so far.
Perhaps this script could be helpful in making the modifications.
I perused the hdmf-zarr source code, but it wasn't clear to me where the changes needed to take place.
Tagging: @rly
Do you have any interest in helping implement the feature?
Yes.
Code of Conduct
The text was updated successfully, but these errors were encountered: