11import numpy as np
22from pynwb import NWBHDF5IO
33from pynwb .testing .mock .file import mock_NWBFile
4+ from pynwb .testing .mock .base import mock_TimeSeries
45from unittest import TestCase
56
67from ndx_franklab_novela import FrankLabOptogeneticEpochsTable , CameraDevice
@@ -11,6 +12,9 @@ class TestFrankLabOptogeneticsEpochsTable(TestCase):
1112 def test_roundtrip (self ):
1213 nwbfile = mock_NWBFile ()
1314
15+ stimulus = mock_TimeSeries ()
16+ nwbfile .add_stimulus (stimulus )
17+
1418 camera1 = CameraDevice (
1519 name = "overhead_run_camera 1" ,
1620 description = "Camera used for tracking running" ,
@@ -68,7 +72,10 @@ def test_roundtrip(self):
6872 ripple_filter_lockout_period_in_samples = 10 ,
6973 ripple_filter_threshold_sd = 5.0 ,
7074 ripple_filter_num_above_threshold = 4 ,
75+ speed_filter_on = True ,
76+ speed_filter_threshold_in_cm_per_s = 10.0 ,
7177 speed_filter_on_above_threshold = True ,
78+ stimulus_signal = stimulus ,
7279 )
7380 nwbfile .add_time_intervals (opto_epochs )
7481
@@ -114,3 +121,7 @@ def test_roundtrip(self):
114121 assert read_epochs [0 , "ripple_filter_lockout_period_in_samples" ] == 10
115122 assert read_epochs [0 , "ripple_filter_threshold_sd" ] == 5.0
116123 assert read_epochs [0 , "ripple_filter_num_above_threshold" ] == 4
124+ assert read_epochs [0 , "speed_filter_on" ]
125+ assert read_epochs [0 , "speed_filter_threshold_in_cm_per_s" ] == 10.0
126+ assert read_epochs [0 , "speed_filter_on_above_threshold" ]
127+ assert read_epochs [0 , "stimulus_signal" ].object_id == stimulus .object_id
0 commit comments