Skip to content

Conversation

@h-mayorquin
Copy link
Collaborator

@h-mayorquin h-mayorquin commented Nov 12, 2024

Sup, @bendichter I wanted to write this here so we have an anchor point for discussion next time we meet. Taking the electrodes table as a starting point there are two objects that we are not catching for chunkg at the moment:

  • ElectrodeGroups column
  • Ids.

Check the code below for more comments but the gist of where I got stuck is here:


<HDF5 dataset "id": shape (2,), type "<i8">
data.chunks
(2,)
data.maxshape
(2,)
data.resize(shape)
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/heberto/miniconda3/envs/work/lib/python3.11/site-packages/h5py/_hl/dataset.py", line 679, in resize
    self.id.set_extent(size)
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "h5py/h5d.pyx", line 335, in h5py.h5d.DatasetID.set_extent
RuntimeError: Unable to synchronously change a dataset's dimensions (dimension cannot e

For the ids, the data was chunk but the maxshape was also so it becomes non-expandable.

Important, note that for hdf5 we only pass chunk to the DataIO:
https://github.com/catalystneuro/neuroconv/blob/df9d6f84a70f0840d78c09c42dd6e67afd24ff3c/src/neuroconv/tools/nwb_helpers/_configuration_models/_zarr_dataset_io.py#L132-L133

@h-mayorquin h-mayorquin self-assigned this Nov 12, 2024
for column in dynamic_table.columns:
candidate_dataset = column.data # VectorData object
dynamic_table = neurodata_object # For readability
for column in (*dynamic_table.columns, dynamic_table.id):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, we add the ids of the tables to the set that we catch for setting the DataIO.

# Skip over columns whose values are links, such as the 'group' of an ElectrodesTable
if any(isinstance(value, Container) for value in candidate_dataset):
continue # Skip
# if any(isinstance(value, Container) for value in candidate_dataset):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I commented this because this was catching the ElectrodeGroups column. There is probably a better way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants