def test_values(self):
"""
Tests if the routine loads the correct numbers from the file.
"""
id_to_test = 1
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)
seg = r.read_segment(gid_list=[id_to_test],
t_start=400. * pq.ms,
t_stop=500. * pq.ms, lazy=False,
id_column_gdf=0, time_column_gdf=1)
dat = np.loadtxt(filename)
target_data = dat[:, 1][np.where(dat[:, 0] == id_to_test)]
st = seg.spiketrains[0]
np.testing.assert_array_equal(st.magnitude, target_data)
评论列表
文章目录