devctrl.data.data.Data#

class Data(data_path: str, file_mode: str = '', metadata: dict | None = None)[source]#

Bases: object

General 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_color

get_column_label

get_column_label_with_unit

get_column_scale

get_column_tex_label

get_column_tex_label_with_unit

get_column_tex_label_with_unit_and_scale

get_column_tex_unit

get_column_unit

Attributes

data_path

Absolute path to the data file or directory

dir_path

Absolute path to the data directory

dir_name

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