devctrl.data.time.data.TimeData#
- class TimeData(*args, **kwargs)[source]#
Bases:
Data,ABCMethods
Attributes
Absolute path to the data file or directory
Absolute path to the data directory
Name of the data directory
- _EQUALITY_CHECKS = {'endswith': <function Data.<lambda>>, 'equal': <function Data.<lambda>>, 'startswith': <function Data.<lambda>>}#
- __abstractmethods__ = frozenset({'get_time_data'})#
- __annotations__ = {}#
- __dict__ = mappingproxy({'__module__': 'devctrl.data.time.data', '__firstlineno__': 6, '__init__': <function TimeData.__init__>, 'get_time_data': <function TimeData.get_time_data>, '__static_attributes__': (), '__doc__': None, '__abstractmethods__': frozenset({'get_time_data'}), '_abc_impl': <_abc._abc_data object>, '__annotations__': {}})#
- __firstlineno__ = 6#
- classmethod __init_subclass__(**kwargs)#
Auto-register subclasses
- __module__ = 'devctrl.data.time.data'#
- __slots__ = ()#
- __static_attributes__ = ()#
- __weakref__#
list of weak references to the object
- _abc_impl = <_abc._abc_data object>#
- _assert_read_mode()#
- Raises:
RuntimeError – If instance was not initialized in read mode
- _assert_write_mode()#
- Raises:
RuntimeError – If instance was not initialized in write mode
- classmethod _get_column_data(key, column, default=None, mode='*', check_other_cls=True, instance=None)#
Search for column data in _COLUMN_DATA hierarchy
Searches for the specified key and column in the _COLUMN_DATA dictionary following a priority order: specific mode → wildcard mode → other subclasses → default.
- Parameters:
key – Data key (e.g., ‘label’)
column – Column key to retrieve
default – Default value to return if no data is found
mode – Optional data mode to search in
check_other_cls – Whether to check other Data subclasses before returning default
instance – Optional Data subclass instance to auto-determine mode from .mode attribute
- Returns:
The found column data or default value
- classmethod _get_column_key(key, value, default=None, mode='*', check_other_modes=True, check_other_cls=True, equality_check='equal')#
Reverse search of column data: returns the column key for the given data key and value. First checks the calling class, then all other subclasses.
- Parameters:
key – data key, e.g. ‘label’
value – the value of _COLUMN_DATA[mode][key][column] for which the column is returned
default – a default value to return of no value is found
mode – optional data mode
check_other_modes – whether to check if another mode in _COLUMN_DATA has the column data
check_other_cls – whether to check if other subclasses have the column data before returning the default
equality_check – How to check equality: ‘equal’, ‘startswith’ or ‘endswith’. The latter check if the searched value starts with the column data value
- Returns:
The column key to given value from _COLUMN_DATA
- _subclasses = {'PrsData': <class 'prsctrl.data.prsdata.PrsData'>, 'TimeData': <class 'devctrl.data.time.data.TimeData'>}#
- 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
- get_column_color(**kw)#
- get_column_label(**kw)#
- get_column_label_with_unit(**kw)#
- get_column_scale(**kw)#
- get_column_tex_label(**kw)#
- get_column_tex_label_with_unit(**kw)#
- get_column_tex_label_with_unit_and_scale(**kw)#
- get_column_tex_unit(**kw)#
- get_column_unit(**kw)#
- abstractmethod get_time_data(columns: list[str], transforms: list[Callable[[ndarray[tuple[Any, ...], dtype[_ScalarT]], list[str]], tuple[ndarray[tuple[Any, ...], dtype[_ScalarT]], list[str]]]] | None = None, ts: list[float] | tuple[float, float] | None = None) tuple[list[str], ndarray[tuple[Any, ...], dtype[_ScalarT]]][source]#