Skip to content

Commit d212c64

Browse files
committed
Coarse-grain data merge using tics
1 parent 3ad45c8 commit d212c64

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

testsuite/pytests/utilities/testutil.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import sys
2323

24+
import nest
2425
import pandas as pd
2526
import pytest
2627

@@ -54,12 +55,14 @@ def get_comparable_timesamples(resolution, actual, expected):
5455
actual and expected, respectively.
5556
"""
5657

58+
tics = nest.tics_per_ms
59+
5760
actual = pd.DataFrame(actual, columns=["t", "val_a"])
5861
expected = pd.DataFrame(expected, columns=["t", "val_e"])
5962

60-
actual["steps"] = (actual.t / resolution).round().astype(int)
61-
expected["steps"] = (expected.t / resolution).round().astype(int)
63+
actual["tics"] = (actual.t * tics).round().astype(int)
64+
expected["tics"] = (expected.t * tics).round().astype(int)
6265

63-
common = pd.merge(actual, expected, how="inner", on="steps")
66+
common = pd.merge(actual, expected, how="inner", on="tics")
6467

6568
return common.val_a.values, common.val_e.values

0 commit comments

Comments
 (0)