How to …¶
A collection or recipes for how to do various things in TMPL.
How to access measured data?¶
Measured data is stored in the .ds_results property of any TMPL object. Data from all measurements can be accessed from the top level TestManager object:
test_seq.ds_results
.ds_results is an xarray Dataset object.
How to repeat a test sequence multiple times?¶
Repeating a whole test sequence can be done multiple times by enabling the Iteration condition. This is a SetupCondition class that is populated by default but disabled. It is a counter where you set the number of iterations of the test sequence. To set multiple runs through the sequence follow the code below:
# Enable Iteration condition
test_seq.conditions.Iteration.enable = True
# Set iterations as a list, e.g. for 3 iterations
test_seq.conditions.Iteration.values = [0,1,2]
# For many iterations use a list comprehension
test_seq.conditions.Iteration.values = [n for n in range(100)]
WARNING When iterating a whole sequence make sure that the code in the Measurement and SetupCondition classes can handle this, i.e. instrument settings are reset at the start of the sequence.
After the iterations have finished inspect the test_seq.df_results property. There will be a coordinate called Iteration for all measured data.
How to add a timestamp to df_results¶
This is done automatically. A Measurement called Timestamp is always added to every test sequence.