read_variables

The biaxial testing machine can use a command called “Save variables to file”. This will save the variables listed in an xml format. This module is used to read this file and save the variable information in a dictionary format. Two output types are possible:

  • Variable list: A list containing the variables written each time the “Save variables to file” command is called (get_variable_list())

  • Dictionary: Three dictionaries with keys according to the variable name (get_variable_dicts())

    • The data for each variable as np.arrays

    • The unit for each variable

    • The indices (counter for output commands) for each variable

read_variables.get_variable_dicts(file)[source]

Get the variable dictionary output from the xml-formatted file

Parameters:

file (str, pathlike) – Path to the xml-formatted file

Returns:

Three dictionaries: data, unit, inds

Return type:

tuple( dict )

read_variables.var_list_to_dicts(var_list)[source]

Convert Variable list output to dictionary data output

Parameters:

var_list (list[ dict ]) – Output from get_variable_list()

Returns:

Three dictionaries: data, unit, inds

Return type:

tuple( dict )

read_variables.get_variable_list(file)[source]

Get the Variable list output from the xml-formatted file

Parameters:

file (str, pathlike) – Path to the xml-formatted file

Returns:

A list where each item contains a dictionary describing the variables written that time the “Save variable to file” function was called in the test program. The keys in the dictionary are the variable names, and each dict contains tuple with a data list (often a single element) followed by a string describing the unit

Return type:

list[ dict ]