vitabel.typing

Common type aliases used in the package.

Attributes

Timedelta

Type alias of a time difference / duration.

Timestamp

Type alias of a time stamp.

ChannelSpecification

Type alias for different ways to specify a Channel.

LabelSpecification

Type alias for different ways to specify a Label.

LabelPlotType

LabelPlotVLineTextSource

IntervalLabelPlotType

LabelAnnotationPresetType

Classes

EOLifeRecord

Metric

Auxiliary dataclass used to store (numeric) values and their unit.

ThresholdMetrics

Auxiliary dataclass used to represent threshold regions.

DataSlice

Auxiliary dataclass holding a slice of data from a label or channel.

PhaseData

Data for a single respiratory phase (inspiration or expiration).

RespPhases

Auxiliary dataclass used to represent respiratory phases information.

Module Contents

type vitabel.typing.Timedelta = pd.Timedelta | np.timedelta64

Type alias of a time difference / duration.

type vitabel.typing.Timestamp = pd.Timestamp | np.datetime64

Type alias of a time stamp.

type vitabel.typing.ChannelSpecification = str | dict[str, Any] | 'Channel'

Type alias for different ways to specify a Channel.

type vitabel.typing.LabelSpecification = str | dict[str, Any] | 'Label'

Type alias for different ways to specify a Label.

type vitabel.typing.LabelPlotType = Literal['scatter', 'vline', 'combined']
type vitabel.typing.LabelPlotVLineTextSource = Literal['data', 'text_data', 'combined', 'disabled']
type vitabel.typing.IntervalLabelPlotType = Literal['box', 'hline', 'combined']
type vitabel.typing.LabelAnnotationPresetType = Literal['timestamp', 'numerical', 'textual', 'combined']
class vitabel.typing.EOLifeRecord
data: pandas.DataFrame
recording_start: pandas.Timestamp
metadata: dict[str, Any]
column_metadata: dict[str, dict[str, str]]
class vitabel.typing.Metric

Auxiliary dataclass used to store (numeric) values and their unit.

Parameters:
value

A numeric value.

unit

String representation of the unit of the stored value.

value: float
unit: str
class vitabel.typing.ThresholdMetrics

Auxiliary dataclass used to represent threshold regions.

Parameters:
area_under_threshold

The area under the curve below the threshold. Unit stored in Metric.unit (e.g., "minutes × unit of singal").

duration_under_threshold

The total duration the signal remained below the threshold.

time_weighted_average_under_threshold

Area under the threshold divided by the observational_interval_duration, Unit stored in Metric.unit (unit of signal).

observational_interval_duration

Time interval length from first last recording.

area_under_threshold: Metric
duration_under_threshold: pandas.Timedelta
time_weighted_average_under_threshold: Metric
observational_interval_duration: pandas.Timedelta
class vitabel.typing.DataSlice

Auxiliary dataclass holding a slice of data from a label or channel.

Primarily used in the various get_data methods.

time_index: pandas.DatetimeIndex | pandas.TimedeltaIndex | numpy.typing.NDArray[numpy.datetime64] | numpy.typing.NDArray[numpy.timedelta64]

The time index of the selected data range.

data: numpy.typing.NDArray | None = None

The data of the selected data range, or None if no data is available.

text_data: numpy.typing.NDArray | None = None

The text data of the selected data range, or None if no text data is available.

class vitabel.typing.PhaseData

Data for a single respiratory phase (inspiration or expiration).

Parameters:
onsets_above_threshold

Array of timestamps marking onsets above threshold. Solely fulfilling the condition of being above the threshold. No further filtering.

filtered_onsets_above_threshold

Array of timestamps marking onsets above threshold. Filtered by alternating expiration phases.

candidates

Array of candidate timestamps for the start of inspiration phases. Yet, not filtered as alternating phases.

begins

Array of timestamps marking the beginning of inspiration phases. Filtered by alternating expiration phases.

intervals

Array of intervals marking the intervals of inspiration phases.

threshold

The threshold value used to detect inspiration phases.

onsets_above_threshold: numpy.typing.NDArray
filtered_onsets_above_threshold: numpy.typing.NDArray
candidates: numpy.typing.NDArray
begins: numpy.typing.NDArray
intervals: list[tuple[pandas.Timestamp, pandas.Timestamp]]
threshold: float
class vitabel.typing.RespPhases

Auxiliary dataclass used to represent respiratory phases information.

Parameters:
inspiration

All inspiration-related phase data.

expiration

All expiration-related phase data.

inspiration: PhaseData
expiration: PhaseData