DataCollection
eitprocessing.datahandling.datacollection
¶
DataCollection
¶
DataCollection(data_type: type[V], *args, **kwargs)
A collection of a single type of data with unique labels.
A DataCollection functions largely as a dictionary, but requires a data_type argument, which must be one of the data containers existing in this package. When adding an item to the collection, the type of the value must match the data_type of the collection. Furthermore, the key has to match the attribute 'label' attached to the value.
The convenience method add()
adds an item by setting the key to value.label
.
PARAMETER | DESCRIPTION |
---|---|
data_type
|
the data container stored in this collection.
TYPE:
|
t
property
¶
t: TimeIndexer
add
¶
add(*item: V, overwrite: bool = False) -> None
Add one or multiple item(s) to the collection using the item label as the key.
get_loaded_data
¶
Return all data that was directly loaded from disk.
get_data_derived_from
¶
Return all data that was derived from a specific source.
get_derived_data
¶
Return all data that was derived from any source.
concatenate
¶
Concatenate this collection with an equivalent collection.
Each item of self of concatenated with the item of other with the same key.
select_by_time
¶
select_by_time(
start_time: float | None,
end_time: float | None,
start_inclusive: bool = True,
end_inclusive: bool = False,
) -> DataCollection
Return a DataCollection containing sliced copies of the items.
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. |