-
Notifications
You must be signed in to change notification settings - Fork 24
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
Fix chunking bug with compound dtypes #1146
Conversation
@rly, lmk what you think |
@h-mayorquin, this is ready for review. Basically I use the hdmf.build.builders.BaseBuilder to check if a neurodata object would have a compound dtype. Most of the complexity is introduced by the need to find a match between the neurodata object and its location in the builder, which is outlined in the docstrings. Lmk what you think! |
I did a first reading. Two things:
|
I updated to include everything <4, which zarr-related issues. Should be able to add hdmf 4.0 soon -- see: #1191 |
Definitely needs some unit tests. I'll put together some. |
From Meeting: move has_compound_dtype inside get_data_shape |
Actually, |
@h-mayorquin, i added tests, so this should be good to go! |
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.
My apologies regarding the get_data_shape
function.
I propose we create a new function called get_full_data_shape
in src/neuroconv/tools/hdmf.py
and consolidate all related functionality there. It seems that this should be something provided by HDMF, and isolating this complexity from the rest of the code would be ideal.
There is also a coupling issue with the calculation of the manager for the entire file. I would prefer not to require from_neurodata_object
to accept an additional argument that is build related. However, calculating the manager for every dataset is probably too expensive, and using the manager to build only for the dataset doesn't work (based on my initial attempt).
Requests:
-
Centralize Logic:
Move the code to HDMF in thetools
directory and create a new function,get_full_shape
, that takes the builder as an optional argument so that all the logic is centralized. In the docstring, document thatget_data_shape
fails for compound objects and that this behavior is desired for building a dataset I/O configuration object. -
Add Tests:
Add a test that asserts the correct behavior of either the new functionget_dataset_full_shape
or the dataset IO configuration produced by thefrom_neurodata_object
method. See the more concrete request on the review.
.../test_backend_and_dataset_configuration/test_models/test_dataset_io_configuration_helpers.py
Show resolved
Hide resolved
src/neuroconv/tools/nwb_helpers/_configuration_models/_base_dataset_io.py
Show resolved
Hide resolved
.../test_backend_and_dataset_configuration/test_models/test_dataset_io_configuration_helpers.py
Show resolved
Hide resolved
...ls/test_backend_and_dataset_configuration/test_models/test_dataset_io_configuration_model.py
Outdated
Show resolved
Hide resolved
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.
LGTM
Should we, in another PR, increase the floor of the hdmf version? Remove the ceiling?
Sure, can you take care of that? |
@pauladkisson |
I don't think we need to as long as it remains compatible with spikeinterface, etc. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1146 +/- ##
==========================================
+ Coverage 89.65% 89.72% +0.07%
==========================================
Files 129 129
Lines 8378 8420 +42
==========================================
+ Hits 7511 7555 +44
+ Misses 867 865 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Fixes #1122
Comapare Dev Tests after the fix: https://github.com/catalystneuro/neuroconv/actions/runs/12960177532/job/36153641201 (2 failed -- see #1188)
To Dev Tests before: https://github.com/catalystneuro/neuroconv/actions/runs/12995279932/job/36241639533 (8 failed)