Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing units so tests run again #269

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified tests/data/input_spikes.h5
Binary file not shown.
10 changes: 6 additions & 4 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,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)
GianlucaFicarelli marked this conversation as resolved.
Show resolved Hide resolved
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)


Expand All @@ -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])
Expand Down Expand Up @@ -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])
Expand Down
Binary file modified tests/data/reporting/spikes.h5
Binary file not shown.
Loading