def test_read_float(self):
"""
Tests if spike times are stored as floats if they
are stored as floats in the file.
"""
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)
st = r.read_spiketrain(gdf_id=1, t_start=400. * pq.ms,
t_stop=500. * pq.ms,
lazy=False, id_column=0, time_column=1)
self.assertTrue(st.magnitude.dtype == np.float)
seg = r.read_segment(gid_list=[1], t_start=400. * pq.ms,
t_stop=500. * pq.ms,
lazy=False, id_column_gdf=0, time_column_gdf=1)
sts = seg.spiketrains
self.assertTrue(all([s.magnitude.dtype == np.float for s in sts]))
评论列表
文章目录