Skip to content
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

[Backend Configuration IIIb] Configure DynamicTable router for set_data_io #700

Merged
merged 17 commits into from
Jan 4, 2024

Conversation

CodyCBakerPhD
Copy link
Member

Adds support for dynamic tables to the backend configuration tool, which previously had a bug related to hdmf-dev/hdmf#1013

@alejoe91 Do note that when testing this, you will need to use HDMF dev (pip install git+https://github.com/hdmf-dev/hdmf.git@dev or fresh pip install -e on this branch)

@CodyCBakerPhD CodyCBakerPhD self-assigned this Jan 2, 2024
@CodyCBakerPhD CodyCBakerPhD enabled auto-merge (squash) January 2, 2024 21:18
Co-authored-by: Alessio Buccino <[email protected]>
@CodyCBakerPhD CodyCBakerPhD requested a review from alejoe91 January 3, 2024 15:37
@alejoe91
Copy link
Contributor

alejoe91 commented Jan 3, 2024

Testing now @CodyCBakerPhD !!! :)

Copy link
Collaborator

@h-mayorquin h-mayorquin left a comment

Choose a reason for hiding this comment

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

This looks good to me. Some small comments that are questions and suggestions (all non-blocking for me).

One big point though is: are we pinning to a hdmf dev branch? What's the justication of this? is this needed with urgency?

requirements-minimal.txt Show resolved Hide resolved
src/neuroconv/tools/nwb_helpers/_configure_backend.py Outdated Show resolved Hide resolved
nwbfile_objects[object_id].set_data_io(dataset_name=dataset_name, data_io_class=data_io_class, **data_io_kwargs)
if isinstance(nwbfile_objects[object_id], Data):
nwbfile_objects[object_id].set_data_io(data_io_class=data_io_class, data_io_kwargs=data_io_kwargs)
elif isinstance(nwbfile_objects[object_id], TimeSeries):
Copy link
Collaborator

Choose a reason for hiding this comment

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

What happens with the timestamps if they are present? Are they chunked compressed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ought to be

Copy link
Collaborator

Choose a reason for hiding this comment

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

Are they Data or a TimeSeries? I guess that was my question.

Copy link
Member Author

Choose a reason for hiding this comment

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

They are a dataset of the TimeSeries

Copy link
Member Author

Choose a reason for hiding this comment

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

(it would enter line 29 here with dataset_name="timestamps")

configure_backend(nwbfile=nwbfile, backend_configuration=backend_configuration)

nwbfile_path = str(tmpdir / f"test_configure_defaults_dynamic_table.nwb.{backend}")
with BACKEND_NWB_IO[backend](path=nwbfile_path, mode="w") as io:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would also avoid inlining the IO class here. I think it makes the code harder to read but is marginal.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we could add a ragged array tests. Does chunking makes sense on those cases? I guess it is very difficult to define a good chunking pattern unlesss your entries are homogeneous.

Copy link
Member Author

Choose a reason for hiding this comment

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

It would; I think we do have general configuration tests for this, just not for the configure_backend call since in principle there's nothing at all different about those special columns that have _index in the name (they are still just VectorData at the end of the day)

@h-mayorquin h-mayorquin disabled auto-merge January 4, 2024 13:47
@CodyCBakerPhD
Copy link
Member Author

What's the justication of this? is this needed with urgency?

The urgency is this is a bug Alessio found when trying out the tools; unable to write something on the electrodes table

Granted there are other ways to disable that detection (on our side, or the users), but it's an intended thing for this feature to support so we should fix it as quickly as we can

@h-mayorquin
Copy link
Collaborator

The urgency is this is a bug Alessio found when trying out the tools; unable to write something on the electrodes table

All right, fine by me to merge. I am not that concerned about pinning to a specific branch or commit outside of a release.

I guess that @alejoe91 will test this so he can approve it once it works.

@CodyCBakerPhD CodyCBakerPhD enabled auto-merge (squash) January 4, 2024 16:47
@CodyCBakerPhD
Copy link
Member Author

@alejoe91 If you can confirm that this allows you to proceed testing configure_backend around that electrodes table issue (but separate from the writing zeros issue, which will be fixed in a follow-up)

Copy link

codecov bot commented Jan 4, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (1ddfe22) 92.20% compared to head (1abca9e) 92.20%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #700      +/-   ##
==========================================
- Coverage   92.20%   92.20%   -0.01%     
==========================================
  Files         115      115              
  Lines        5954     5964      +10     
==========================================
+ Hits         5490     5499       +9     
- Misses        464      465       +1     
Flag Coverage Δ
unittests 92.20% <91.66%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/neuroconv/tools/nwb_helpers/__init__.py 100.00% <100.00%> (ø)
...c/neuroconv/tools/spikeinterface/spikeinterface.py 92.76% <100.00%> (+0.01%) ⬆️
.../neuroconv/tools/nwb_helpers/_configure_backend.py 94.44% <87.50%> (-5.56%) ⬇️

@alejoe91
Copy link
Contributor

alejoe91 commented Jan 4, 2024

@alejoe91 If you can confirm that this allows you to proceed testing configure_backend around that electrodes table issue (but separate from the writing zeros issue, which will be fixed in a follow-up)

confirmed

@CodyCBakerPhD
Copy link
Member Author

confirmed

@alejoe91 Sorry, 'confirm by approving' as per #700 (comment)

@CodyCBakerPhD CodyCBakerPhD merged commit 4bef01d into main Jan 4, 2024
36 checks passed
@CodyCBakerPhD CodyCBakerPhD deleted the set_data_io_debug branch January 4, 2024 18:05
@h-mayorquin
Copy link
Collaborator

Thanks for working on this @CodyCBakerPhD. And lots of love for dealing with questions as usual!

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.

3 participants