def test_t_start_t_stop(self):
"""
Tests if the t_start and t_stop arguments are correctly processed.
"""
filename = get_test_file_full_path(
ioclass=NestIO,
filename='0gid-1time-1256-0.gdf',
directory=self.local_test_dir, clean=False)
r = NestIO(filenames=filename)
t_stop_targ = 490. * pq.ms
t_start_targ = 410. * pq.ms
seg = r.read_segment(gid_list=[], t_start=t_start_targ,
t_stop=t_stop_targ, lazy=False,
id_column_gdf=0, time_column_gdf=1)
sts = seg.spiketrains
self.assertTrue(np.max([np.max(st.magnitude) for st in sts
if len(st) > 0])
< t_stop_targ.rescale(sts[0].times.units).magnitude)
self.assertTrue(np.min([np.min(st.magnitude) for st in sts
if len(st) > 0])
>= t_start_targ.rescale(sts[0].times.units).magnitude)
评论列表
文章目录