diff --git a/tests/data/input_spikes.h5 b/tests/data/input_spikes.h5 index eed8e9eb..3006f1e9 100644 Binary files a/tests/data/input_spikes.h5 and b/tests/data/input_spikes.h5 differ diff --git a/tests/data/reporting/create_reports.py b/tests/data/reporting/create_reports.py index 761da564..c086ecc2 100644 --- a/tests/data/reporting/create_reports.py +++ b/tests/data/reporting/create_reports.py @@ -3,6 +3,8 @@ import h5py import numpy as np +string_dtype = h5py.special_dtype(vlen=str) + def write_spikes(filepath): population_names = ["default", "default2"] @@ -16,13 +18,15 @@ def write_spikes(filepath): gpop_spikes = h5f.create_group("/spikes/" + population_names[0]) gpop_spikes.attrs.create("sorting", data=2, dtype=sorting_type) timestamps, node_ids = zip(*sorted(zip(timestamps_base, node_ids_base))) - gpop_spikes.create_dataset("timestamps", data=timestamps, dtype=np.double) + dtimestamps = gpop_spikes.create_dataset("timestamps", data=timestamps, dtype=np.double) + dtimestamps.attrs.create("units", data="ms", dtype=string_dtype) gpop_spikes.create_dataset("node_ids", data=node_ids, dtype=np.uint64) gpop_spikes2 = h5f.create_group("/spikes/" + population_names[1]) gpop_spikes2.attrs.create("sorting", data=1, dtype=sorting_type) node_ids, timestamps = zip(*sorted(zip(node_ids_base, timestamps_base))) - gpop_spikes2.create_dataset("timestamps", data=timestamps, dtype=np.double) + dtimestamps2 = gpop_spikes2.create_dataset("timestamps", data=timestamps, dtype=np.double) + dtimestamps2.attrs.create("units", data="ms", dtype=string_dtype) gpop_spikes2.create_dataset("node_ids", data=node_ids, dtype=np.uint64) @@ -33,7 +37,6 @@ def write_soma_report(filepath): element_ids = np.zeros(3) times = (0.0, 1.0, 0.1) data = [node_ids + j * 0.1 for j in range(10)] - string_dtype = h5py.special_dtype(vlen=str) with h5py.File(filepath, "w") as h5f: h5f.create_group("report") gpop_all = h5f.create_group("/report/" + population_names[0]) @@ -70,7 +73,6 @@ def write_element_report(filepath): times = (0.0, 1, 0.1) - string_dtype = h5py.special_dtype(vlen=str) with h5py.File(filepath, "w") as h5f: h5f.create_group("report") gpop_element = h5f.create_group("/report/" + population_names[0]) diff --git a/tests/data/reporting/spikes.h5 b/tests/data/reporting/spikes.h5 index a644b098..7ffdad01 100644 Binary files a/tests/data/reporting/spikes.h5 and b/tests/data/reporting/spikes.h5 differ