Sequence
eitprocessing.datahandling.sequence
¶
Sequence
dataclass
¶
Sequence(
label: str | None = None,
name: str | None = None,
description: str = "",
eit_data: DataCollection[EITData] = (lambda: DataCollection(EITData))(),
continuous_data: DataCollection[ContinuousData] = (
lambda: DataCollection(ContinuousData)
)(),
sparse_data: DataCollection[SparseData] = (
lambda: DataCollection(SparseData)
)(),
interval_data: DataCollection[IntervalData] = (
lambda: DataCollection(IntervalData)
)(),
)
Sequence of timepoints containing respiratory data.
A Sequence object is a representation of data points over time. These data can consist of any combination of EIT
frames (EITData
), waveform data (ContinuousData
) from different sources, or individual events (SparseData
)
occurring at any given timepoint. A Sequence can consist of an entire measurement, a section of a measurement, a
single breath, or even a portion of a breath. A Sequence can consist of multiple sets of each type of data from the
same time-points or can be a single measurement from just one source.
A Sequence can be split up into separate sections of a measurement or multiple (similar) Sequence objects can be merged together to form a single Sequence.
PARAMETER | DESCRIPTION |
---|---|
label
|
Computer readable naming of the instance.
TYPE:
|
name
|
Human readable naming of the instance.
TYPE:
|
description
|
Human readable extended description of the data.
TYPE:
|
eit_data
|
Collection of one or more sets of EIT data frames.
TYPE:
|
continuous_data
|
Collection of one or more sets of continuous data points.
TYPE:
|
sparse_data
|
Collection of one or more sets of individual data points.
TYPE:
|
data
property
¶
Shortcut access to data stored in collections inside a sequence.
This allows all data objects stored in a collection inside a sequence to be accessed.
Instead of sequence.continuous_data["global_impedance"]
you can use
sequence.data["global_impedance"]
. This works for getting (sequence.data["label"]
or
sequence.data.get("label")
) and adding data (sequence.data["label"] = obj
or
sequence.data.add(obj)
).
Other dict-like behaviour is also supported:
label in sequence.data
to check whether an object with a label exists;del sequence.data[label]
to remove an object from the sequence based on the label;for label in sequence.data
to iterate over the labels;sequence.data.items()
to retrieve a list of (label, object) pairs, especially useful for iteration;sequence.data.labels()
orsequence.data.keys()
to get a list of data labels;sequence.data.objects()
orsequence.data.values()
to get a list of data objects.
This interface only works if the labels are unique among the data collections. An attempt to add a data object with an exiting label will result in a KeyError.
t
property
¶
t: TimeIndexer
concatenate
classmethod
¶
Create a merge of two Sequence objects.
select_by_time
¶
select_by_time(
start_time: float | None = None,
end_time: float | None = None,
start_inclusive: bool = True,
end_inclusive: bool = False,
label: str | None = None,
name: str | None = None,
description: str = "",
) -> Self
Return a sliced version of the Sequence.
See SelectByTime.select_by_time()
.
select_by_index
¶
select_by_index(
start: int | None = None,
end: int | None = None,
newlabel: str | None = None,
) -> Self
De facto implementation of the __getitem__
function.
This function can also be called directly to add a label to the sliced object. Otherwise a default label describing the slice and original object is attached.
isequivalent
¶
Test whether the data structure between two objects are equivalent.
Equivalence, in this case means that objects are compatible e.g. to be merged. Data content can vary, but e.g. the category of data (e.g. airway pressure, flow, tidal volume) and unit, etc., must match.
PARAMETER | DESCRIPTION |
---|---|
other
|
object that will be compared to self.
TYPE:
|
raise_
|
sets this method's behavior in case of non-equivalence. If
True, an
TYPE:
|
RAISES | DESCRIPTION |
---|---|
EquivalenceError
|
if |
RETURNS | DESCRIPTION |
---|---|
bool
|
bool describing result of equivalence comparison. |