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

allow for TimeSeries with just timestamps specified #1848

Merged
merged 2 commits into from
Feb 22, 2024

Conversation

bendichter
Copy link
Contributor

@bendichter bendichter commented Feb 21, 2024

Motivation

Previously, if you wanted to use mock_TimeSeries while specifying timestamps, you would also need to set rate=None.

from pynwb.testing.mock.base import mock_TimeSeries

mock_TimeSeries(timestamps=[1,2,3,4])  # this used to fail

You had to specify rate=None explicitly, which is not ideal

mock_TimeSeries(timestamps=[1,2,3,4], rate=None)  # this was the fix

Now, you don't need to.

from pynwb.testing.mock.base import mock_TimeSeries

mock_TimeSeries()  # this works
mock_TimeSeries(timestamps=[1,2,3,4])  # this works
mock_TimeSeries(rate=10.0)  # this works
mock_TimeSeries(timestamps=[1,2,3,4], rate=10.0)  # this rightfully fails

Copy link

codecov bot commented Feb 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7d19192) 91.95% compared to head (d3e2dd8) 91.95%.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #1848   +/-   ##
=======================================
  Coverage   91.95%   91.95%           
=======================================
  Files          27       27           
  Lines        2661     2661           
  Branches      699      699           
=======================================
  Hits         2447     2447           
  Misses        142      142           
  Partials       72       72           
Flag Coverage Δ
integration 70.80% <ø> (ø)
unit 84.14% <ø> (ø)

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.

@bendichter bendichter enabled auto-merge (squash) February 21, 2024 23:40
@bendichter bendichter merged commit 65b2a7d into dev Feb 22, 2024
23 checks passed
@bendichter bendichter deleted the fix_mock_timeseries branch February 22, 2024 00:04
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