vitabel.typing ============== .. py:module:: vitabel.typing .. autoapi-nested-parse:: Common type aliases used in the package. .. !! processed by numpydoc !! Attributes ---------- .. autoapisummary:: vitabel.typing.Timedelta vitabel.typing.Timestamp vitabel.typing.ChannelSpecification vitabel.typing.LabelSpecification vitabel.typing.LabelPlotType vitabel.typing.LabelPlotVLineTextSource vitabel.typing.IntervalLabelPlotType vitabel.typing.LabelAnnotationPresetType Classes ------- .. autoapisummary:: vitabel.typing.EOLifeRecord vitabel.typing.Metric vitabel.typing.ThresholdMetrics vitabel.typing.DataSlice vitabel.typing.PhaseData vitabel.typing.RespPhases Module Contents --------------- .. py:type:: Timedelta :canonical: pd.Timedelta | np.timedelta64 Type alias of a time difference / duration. .. !! processed by numpydoc !! .. py:type:: Timestamp :canonical: pd.Timestamp | np.datetime64 Type alias of a time stamp. .. !! processed by numpydoc !! .. py:type:: ChannelSpecification :canonical: Union[str, dict[str, Any], 'Channel'] Type alias for different ways to specify a Channel. .. !! processed by numpydoc !! .. py:type:: LabelSpecification :canonical: Union[str, dict[str, Any], 'Label'] Type alias for different ways to specify a Label. .. !! processed by numpydoc !! .. py:type:: LabelPlotType :canonical: Literal['scatter', 'vline', 'combined'] .. py:type:: LabelPlotVLineTextSource :canonical: Literal['data', 'text_data', 'combined', 'disabled'] .. py:type:: IntervalLabelPlotType :canonical: Literal['box', 'hline', 'combined'] .. py:type:: LabelAnnotationPresetType :canonical: Literal['timestamp', 'numerical', 'textual', 'combined'] .. py:class:: EOLifeRecord .. py:attribute:: data :type: pandas.DataFrame .. py:attribute:: recording_start :type: pandas.Timestamp .. py:attribute:: metadata :type: dict[str, Any] .. py:attribute:: column_metadata :type: dict[str, dict[str, str]] .. py:class:: 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. .. !! processed by numpydoc !! .. py:attribute:: value :type: float .. py:attribute:: unit :type: str .. py:class:: ThresholdMetrics Auxiliary dataclass used to represent threshold regions. :Parameters: **area_under_threshold** The area under the curve below the threshold. Unit stored in :attr:`.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 :attr:`Metric.unit` (unit of signal). **observational_interval_duration** Time interval length from first last recording. .. !! processed by numpydoc !! .. py:attribute:: area_under_threshold :type: Metric .. py:attribute:: duration_under_threshold :type: pandas.Timedelta .. py:attribute:: time_weighted_average_under_threshold :type: Metric .. py:attribute:: observational_interval_duration :type: pandas.Timedelta .. py:class:: DataSlice Auxiliary dataclass holding a slice of data from a label or channel. Primarily used in the various ``get_data`` methods. .. !! processed by numpydoc !! .. py:attribute:: time_index :type: pandas.DatetimeIndex | pandas.TimedeltaIndex | numpy.typing.NDArray[numpy.datetime64] | numpy.typing.NDArray[numpy.timedelta64] The time index of the selected data range. .. !! processed by numpydoc !! .. py:attribute:: data :type: numpy.typing.NDArray | None :value: None The data of the selected data range, or ``None`` if no data is available. .. !! processed by numpydoc !! .. py:attribute:: text_data :type: numpy.typing.NDArray | None :value: None The text data of the selected data range, or ``None`` if no text data is available. .. !! processed by numpydoc !! .. py:class:: 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. .. !! processed by numpydoc !! .. py:attribute:: onsets_above_threshold :type: numpy.typing.NDArray .. py:attribute:: filtered_onsets_above_threshold :type: numpy.typing.NDArray .. py:attribute:: candidates :type: numpy.typing.NDArray .. py:attribute:: begins :type: numpy.typing.NDArray .. py:attribute:: intervals :type: list[tuple[pandas.Timestamp, pandas.Timestamp]] .. py:attribute:: threshold :type: float .. py:class:: RespPhases Auxiliary dataclass used to represent respiratory phases information. :Parameters: **inspiration** All inspiration-related phase data. **expiration** All expiration-related phase data. .. !! processed by numpydoc !! .. py:attribute:: inspiration :type: PhaseData .. py:attribute:: expiration :type: PhaseData