-
Notifications
You must be signed in to change notification settings - Fork 26
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
Small patch to html repr in #1100 #1201
Conversation
for more information, see https://pre-commit.ci
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #1201 +/- ##
==========================================
- Coverage 89.12% 89.12% -0.01%
==========================================
Files 45 45
Lines 9944 9945 +1
Branches 2825 2826 +1
==========================================
Hits 8863 8863
Misses 762 762
- Partials 319 320 +1 ☔ View full report in Codecov by Sentry. |
@rly this was the case we discussed in person yesterday, do you know if there any other edge cases we should consider when a |
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.
@h-mayorquin could you add a comment to this line indicating that even if the object has a read_io
the array may still be a numpy array, so generate_dataset_html
will be called even if it is not an HDF5/Zarr dataset.
Line 758 in be602e5
repr_html = read_io.generate_dataset_html(array) |
At some point we may want to add a HDMFIO.is_dataset
method, so that generate_dataset_html
is not unnecessarily called on a numpy array, but I think a comment is sufficient for now. Other than that, Iooks good to me!
@stephprince |
Sounds good, let's merge this for now and I will take a look at the other solution you proposed later. Since this is a small patch to #1100 I think it is ok to not include a changelog update. |
Motivation
There are some edge cases that #1100 did not take into account. I am submitting this patch for discussion, happy to close if a better solution comes.
The problem is that the code here assumes that things that have an IO are hdf5 datasets:
hdmf/src/hdmf/backends/hdf5/h5tools.py
Lines 1612 to 1623 in be602e5
hdmf/src/hdmf/container.py
Lines 754 to 763 in be602e5
But sometimes, this assumption is false. For example, the starting frames of an ImageSeries are a numpy object even after they are written. Maybe there are more such cases?
How to test the behavior?
The following code generates an error when using dev.
Checklist
CHANGELOG.md
with your changes?