devctrl.data.data.Data#
- class Data(data_path: str, file_mode: str = '', metadata: dict | None = None)[source]#
Bases:
objectGeneral purpose data class parent.
The idea is to flexible in the data storage, by not hard-coding indices but instead using data columns that refer to the columnd of a 2D-numpy array. Each column should then have a simple key. By defining a dictionary called _COLUMN_DATA, you can define extra stuff for each column, for example the label and unit it should have in a csv or plot. For example when plotting with latex expression support, you can easily get a nice axis label by then calling data.get_column_tex_label_with_unit(“<key of your column>”). Pre-defined data keys are: - label: Plain-text label - unit: Plain-text unit - label-tex: Latex label - unit-tex: Latex unit - scale: Scaling for plots
Methods
get_column_colorget_column_labelget_column_label_with_unitget_column_scaleget_column_tex_labelget_column_tex_label_with_unitget_column_tex_label_with_unit_and_scaleget_column_tex_unitget_column_unitAttributes
Absolute path to the data file or directory
Absolute path to the data directory
Name of the data directory
- data_path#
Absolute path to the data file or directory
- dir_name: str#
Name of the data directory
- dir_path: str#
Absolute path to the data directory