Commit 1132e64e authored by Mads M. Pedersen's avatar Mads M. Pedersen
Browse files

add time property to list recorder

parent 6a6aad1e
Pipeline #32853 passed with stages
in 22 minutes and 11 seconds
......@@ -233,6 +233,11 @@ class TopFarmListRecorder(SqliteRecorder):
def keys(self):
return list(self.driver_iteration_dict)
@property
def time(self):
t = self['timestamp']
return t - t[0]
class NestedTopFarmListRecorder(TopFarmListRecorder):
def __init__(self, nested_comp, record_id=None):
......
......@@ -99,6 +99,8 @@ def test_ListRecorder():
with pytest.raises(KeyError, match="missing"):
recorder.get('missing')
npt.assert_array_equal(recorder.time, recorder['timestamp'] - recorder['timestamp'][0])
def test_TopFarmListRecorderAnimation(tf_generator):
try:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment