load module
Define functions to load and preprocess the TraceWin files.
- load_dat_file(dat_path: Path, *, keep: Literal['none', 'comments', 'empty lines', 'all'] = 'none', instructions_to_insert: Collection[Instruction] = ()) list[list[str]]
Load the dat file and convert it into a list of lines.
- Parameters:
dat_path (pathlib.Path) – Filepath to the
.datfile, as understood by TraceWin.keep (Literal["none", "comments", "empty lines", "all"], optional) – To determine which un-necessary lines in the dat file should be kept. The default is
'none'.instructions_to_insert (Collection[Instruction], optional) – Some elements or commands that are not present in the
.datfile but that you want to add. The default is an empty tuple.
- Returns:
dat_filecontent – List containing all the lines of dat_path.
- Return type:
- table_structure_file(path: Path) list[list[str]]
Load the file produced by
DataSave table to file.
- results(path: Path, prop: str) ndarray
Load a property from TraceWin’s “Data” table.
- Parameters:
path (pathlib.Path) – Path to results file. It must be saved from TraceWin:
Data>Save table to file.prop (str) – Name of the desired property. Must be in d_property.
- Returns:
data_ref – Array containing the desired property.
- Return type: