Skip to content

Commit

Permalink
Add test for matching timeseries
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelbray32 committed Aug 15, 2023
1 parent 4f876df commit 7a566d6
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion src/spikegadgets_to_nwb/tests/test_convert_ephys.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,14 @@ def test_add_raw_ephys_single_rec():
)
== old_nwbfile.acquisition["e-series"].data[:, 0]
).all()
return read_nwbfile
# check that timestamps are less than one sample different
assert (
(
read_nwbfile.acquisition["e-series"].timestamps[:]
- read_nwbfile.acquisition["e-series"].timestamps[:]
)
< 1 / 30000.0
).all()
os.remove(filename)


Expand Down Expand Up @@ -176,6 +183,14 @@ def test_add_raw_ephys_single_rec_probe_configuration():
)
== old_nwbfile.acquisition["e-series"].data[:, 0]
).all()
# check that timestamps are less than one sample different
assert (
(
read_nwbfile.acquisition["e-series"].timestamps[:]
- read_nwbfile.acquisition["e-series"].timestamps[:]
)
< 1 / 30000.0
).all()

os.remove(filename)

Expand Down Expand Up @@ -270,5 +285,13 @@ def test_add_raw_ephys_two_epoch():
)
== old_nwbfile.acquisition["e-series"].data[:, 0]
).all()
# check that timestamps are less than one sample different
assert (
(
read_nwbfile.acquisition["e-series"].timestamps[:]
- read_nwbfile.acquisition["e-series"].timestamps[:]
)
< 1 / 30000.0
).all()

os.remove(filename)

0 comments on commit 7a566d6

Please sign in to comment.