Skip to content

Commit

Permalink
add test for starting time and update CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
stephprince committed Nov 29, 2023
1 parent ed99b62 commit e8bd8f8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- For `NWBHDF5IO()`, change the default of arg `load_namespaces` from `False` to `True`. @bendichter [#1748](https://github.com/NeurodataWithoutBorders/pynwb/pull/1748)
- Add `NWBHDF5IO.can_read()`. @bendichter [#1703](https://github.com/NeurodataWithoutBorders/pynwb/pull/1703)
- Add `pynwb.get_nwbfile_version()`. @bendichter [#1703](https://github.com/NeurodataWithoutBorders/pynwb/pull/1703)
- Updated timeseries data checks to warn instead of error when reading invalid files. @stephprince [#1793](https://github.com/NeurodataWithoutBorders/pynwb/pull/1793)

## PyNWB 2.5.0 (August 18, 2023)

Expand Down
18 changes: 18 additions & 0 deletions tests/unit/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,24 @@ def test_file_with_rate_and_timestamps_in_construct_mode(self):
timestamps=[1, 2, 3, 4, 5]
)

def test_file_with_starting_time_and_timestamps_in_construct_mode(self):
"""Test that UserWarning is raised when starting_time and timestamps are both specified
while being in construct mode (i.e,. on data read)."""
obj = TimeSeries.__new__(TimeSeries,
container_source=None,
parent=None,
object_id="test",
in_construct_mode=True)
with self.assertWarnsWith(warn_type=UserWarning,
exc_msg='Specifying starting_time and timestamps is not supported.'):
obj.__init__(
name="test_ts",
data=[11, 12, 13, 14, 15],
unit="volts",
starting_time=1.0,
timestamps=[1, 2, 3, 4, 5]
)


class TestImage(TestCase):
def test_init(self):
Expand Down

0 comments on commit e8bd8f8

Please sign in to comment.