-
Notifications
You must be signed in to change notification settings - Fork 85
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] Fix TimeSeries
data does not match length of timestamps should raise an error when created
#1538
base: dev
Are you sure you want to change the base?
[BUG] Fix TimeSeries
data does not match length of timestamps should raise an error when created
#1538
Conversation
…instance is created but only warn when read from file
@oruebel |
This code stores images in an ImageSeries so that they can be referenced by IndexSeries: This approach is no longer the recommended approach. Instead, use the |
@h-mayorquin can you take a look at these conflicts? It would be great to get this PR through |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #1538 +/- ##
=======================================
Coverage 91.73% 91.73%
=======================================
Files 27 27
Lines 2722 2722
Branches 710 709 -1
=======================================
Hits 2497 2497
Misses 149 149
Partials 76 76
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@rly So I don't know how the Images, order of images, and friends would work very well here. |
@@ -71,8 +73,9 @@ | |||
data=dataset.get_stimulus_template(stimulus), | |||
unit="NA", | |||
format="raw", | |||
timestamps=[0.0], | |||
rate=np.nan, |
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.
@rly @bendichter |
We can create the test files in other ways in the nwbinspector. I'll create an issue/PR to adjust that. |
@bendichter @stephprince It is strange that the brain observatory example uses the allensdk API to download an NWB file into a cache folder and then creates a new NWB file with the same data step by step. Do we want to maintain this example? I think everything that is demonstrated here is demonstrated in other tutorials (aside from the allensdk API). This example also causes a minor headache with the test harness because it involves installing allensdk which is not well maintained with new versions of python, and it downloads a 450 MB file, which takes some time. |
@rly I would be in support of removing that tutorial |
Or at least demoting it to some sort of 3rd party untested status |
@rly I'm also in support of removing that example |
I think the allensdk API is demonstrated much more in depth in their documentation and the pynwb examples are all demonstrated in other tutorials like you mentioned. |
I opened #2026 which we can merge first to remove the Brain Observatory example. |
Motivation
This is a follow up on the issue described in #1536 to prevent a
TimeSeries
being created with timestamps that does not match the length of data.This PR changes
TimeSeries
_check_time_series_dimension
check to warn when reading from file and raise an error when constructing new data.This change also affects
ImageSeries
check that will also raise a ValueError when anImageSeries
is being created with timestamps that do not match the length of data. IfImageSeries
is used with external file, then this error or warning will not be triggered.Resolve #1536
How to test the behavior?
Checklist
flake8
from the source directory.