-
Notifications
You must be signed in to change notification settings - Fork 23
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
[Bug]: write_recording()
fails with NWBZarrIO
backend
#202
Comments
Looking through the error stack, I expect this to be an issue more with Not related to the primary issue, but note a nice new convenience we've added for nwb_metadata = dict(session_description="toy_example", identifier="tpy", session_start_time=datetime.now())
nwbfile = NWBFile(**nwb_metadata) which can be done as from nwbinspector.tools import make_minimal_nwbfile
nwbfile = make_minimal_nwbfile() |
Nice! Thanks for the tip! Should we move the discussion on to hdmf-zarr then? |
If you have the time (if not I'll try it later), try (i) writing a nwbfile = make_minimal_nwbfile()
nwbfile.add_acquisition(TimeSeries(name="idk", data=recording.get_traces(), rate=1.)) if that works fine then (ii) try the more fundamentally basic from neuroconv.tools.hdmf import SliceableDataChunkIterator
nwbfile = make_minimal_nwbfile()
nwbfile.add_acquisition(TimeSeries(name="idk", data=SliceableDataChunkIterator(recording.get_traces()), rate=1.)) |
I'll do it right now! |
If that second one gives a similar error then yes, I guess to be extra-sure, you could try (iii) the previous iterator, not as efficient but it 'always works' (? we'll see...) from hdmf.data_utils import DataChunkIterator
nwbfile = make_minimal_nwbfile()
nwbfile.add_acquisition(TimeSeries(name="idk", data=DataChunkIterator(recording.get_traces()), rate=1.)) |
All three examples run fine (the |
Can't quite conclude that just yet. Good to know the iterators work, though. Ah... so the problem now is likely that we do a lot of wrapping of things in |
For
Not sure how this is wrapped in |
Are these equivalent to HDF5 'chunks'? (~1 MB in size, our iterator buffers multiple chunks, 1 GB by default)
Cool, let me know - we're used to just specifying the string name + dict of options through the other wrapper, but if we need to specify a specific codec class we can do the string to class mapping ourselves in NeuroConv (and optionally, of course, allow the user to specify the class explicitly) |
No, they are not in size, but rather in shape: e.g.
Ok sounds good. I'll keep testing different options in the next days! Thanks for the help @CodyCBakerPhD |
Based on the error, I think this is probably an issue with processing of the DataChunkIterator in hdmf-zarr. What is the data type of the data? I won't be able to look at this until later today. I created the following issue on hdmf-zarr as a reminder hdmf-dev/hdmf-zarr#43 |
For this toy example it's |
@oruebel @alejoe91 I just tested the example locally and determined it has nothing to do with the iterators - it's the fact that we automatically wrap all kinds of things in NeuroConv with Fix in progress on #203 but might take some discussion as to how we want to properly go about it (could also factor into to a more general overhaul of our compression option specification, which we've wanted to do for a while) As an aside, the resulting NWB file that I get out of this... is it supposed to look like a folder? This is my first time testing the ZARR backend |
Yep! Zarr is indeed a structured folder structure ;) |
That makes sense. Yes, ZarrIO does not know how to deal with H5DataIO. There is an equivalent ZarrDataIO class that works much in the same way as H5DataIO but some of the options, in particular for compressors, are different. A basic tutorial on ZarrDataIO is here: https://hdmf-zarr.readthedocs.io/en/latest/tutorials/plot_zarr_dataset_io.html#sphx-glr-tutorials-plot-zarr-dataset-io-py For basic setups, e.g., chunking only, we could in principle think about having some form of a "translator" to take H5DataIO objects and translate them to ZarrDataIO, but I don't think that will be possible in all cases as the HDF5 probably has settings that Zarr does not support and vice versa. Let me know if there is anything I can help with to resolve this issue. |
We should close this after we merge: |
I am closing this as this now is supported through the backend configuration |
What happened?
When trying to write a
recording
object using theNWBZarrIO
backend fromhdmf-zarr
, I get the following error related to thelen
of theSpikeInterfaceRecordingDataChunkIterator
.The same
nwbfile
does not produce any error when writing to HDF5.@oruebel @rly I think this might be due to the way
neuroconv
handles the data iteration, but tagging you here in case it's a Zarr backend issue.Steps to Reproduce
Traceback
Operating System
Linux
Python Executable
Python
Python Version
3.9
Package Versions
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: