aboutsummaryrefslogtreecommitdiff
path: root/tests/test_trace.py
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2024-06-18 23:05:26 -0400
committerEugeniy E. Mikhailov <evgmik@gmail.com>2024-06-18 23:05:26 -0400
commitdf78f1f1e8fc390a039dd76ab892919a15da640c (patch)
tree225d77e34846de73e505770bb3611a472e950130 /tests/test_trace.py
parent27efaaa5e49c9033a214f04df538b9fd019efc47 (diff)
downloadqolab-df78f1f1e8fc390a039dd76ab892919a15da640c.tar.gz
qolab-df78f1f1e8fc390a039dd76ab892919a15da640c.zip
added simple test for trace loading
Diffstat (limited to 'tests/test_trace.py')
-rw-r--r--tests/test_trace.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_trace.py b/tests/test_trace.py
new file mode 100644
index 0000000..06f43c5
--- /dev/null
+++ b/tests/test_trace.py
@@ -0,0 +1,11 @@
+from qolab.data.trace import loadTrace
+import numpy as np
+
+def test_load_uncompressed_v0dot1_trace():
+ tr = loadTrace('tests/trace_test_data/xtrace1.dat')
+ cfg = tr.getConfig()
+ assert cfg['config']['version'] == '0.1'
+ assert cfg['config']['model'] == 'Trace'
+ data = tr.getData()
+ assert np.all( (data - np.array([[1], [3], [2], [5]])) == 0 )
+