Skip to content

Commit

Permalink
Fix missing units so tests run again
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeplf committed Sep 2, 2024
1 parent 8b827ca commit 3f72bee
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Binary file modified tests/data/input_spikes.h5
Binary file not shown.
7 changes: 4 additions & 3 deletions tests/data/reporting/create_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -16,7 +18,8 @@ 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])
Expand All @@ -33,7 +36,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])
Expand Down Expand Up @@ -70,7 +72,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])
Expand Down
Binary file modified tests/data/reporting/spikes.h5
Binary file not shown.

0 comments on commit 3f72bee

Please sign in to comment.