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

change from error to warn when timeseries has a zero rate #1809

Merged
merged 2 commits into from
Dec 19, 2023

Conversation

stephprince
Copy link
Contributor

@stephprince stephprince commented Dec 19, 2023

Motivation

See discussion on #1793. There are some cases where TimeSeries with a zero rate have been used to store static microscopy images that we don't want to break back-compatibility for.

  • change the new check to only check for self.rate < 0
  • add a warning for self.rate == 0.0 if the size of the first axis is greater than 1

How to test the behavior?

TimeSeries(name='test_ts1', data=[1, 2, 3], unit='volts', rate=0.0)

Checklist

  • Did you update CHANGELOG.md with your changes?
  • Have you checked our Contributing document?
  • Have you ensured the PR clearly describes the problem and the solution?
  • Is your contribution compliant with our coding style? This can be checked running flake8 from the source directory.
  • Have you checked to ensure that there aren't other open Pull Requests for the same change?
  • Have you included the relevant issue number using "Fix #XXX" notation where XXX is the issue number? By including "Fix #XXX" you allow GitHub to close issue #XXX when the PR is merged.

Copy link

codecov bot commented Dec 19, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (dd2e848) 83.65% compared to head (ec3d31d) 91.98%.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1809      +/-   ##
==========================================
+ Coverage   83.65%   91.98%   +8.33%     
==========================================
  Files          27       27              
  Lines        2618     2620       +2     
  Branches      683      684       +1     
==========================================
+ Hits         2190     2410     +220     
+ Misses        344      138     -206     
+ Partials       84       72      -12     
Flag Coverage Δ
integration 71.18% <0.00%> (?)
unit 83.66% <100.00%> (+0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@oruebel
Copy link
Contributor

oruebel commented Dec 19, 2023

Looks good to me. It would be good if @CodyCBakerPhD or @rly could review just to make sure this is consistent with the discussion in NWBInspector.

@CodyCBakerPhD
Copy link
Collaborator

LGTM

@CodyCBakerPhD
Copy link
Collaborator

IDK what that failing gallery test is about though - probably unrelated?

@stephprince
Copy link
Contributor Author

I think the failing gallery tests are related to #1799, which is an open issue with dandi-schema

@rly
Copy link
Contributor

rly commented Dec 19, 2023

Looks good to me. We can ignore the dandi-schema/pydantic compatibility issue.

Please merge when ready.

@stephprince stephprince merged commit d9a409d into dev Dec 19, 2023
23 of 24 checks passed
@stephprince stephprince deleted the zero-rate-warnings branch December 19, 2023 22:41
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.

None yet

4 participants