diff --git a/eitprocessing/mixins/equality.py b/eitprocessing/mixins/equality.py index 58cececaf..c7aa2e7b9 100644 --- a/eitprocessing/mixins/equality.py +++ b/eitprocessing/mixins/equality.py @@ -32,21 +32,20 @@ def _array_safe_eq(a, b) -> bool: def isequivalent(self, other: Self, raise_: bool = False) -> bool: """Test whether the data structure between two objects are equivalent. - Equivalence in this case means that objects are equal in all respects, - except for data content. Generally data loaded from the same source with - identical preprocessing will be 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. + Args: other: object that will be compared to self. - raise_: - if False (default): return `False` if not equivalent; - if `True`: raise `EquivalenceError` if not equivalence. - checks: Dictionary of bools that will be checked. This dictionary can be - defined in each child class individually. - Defaults to None, meaning that only `type`s are compared. + raise_: sets this method's behavior in case of non-equivalence. If + True, an `EquivalenceError` is raised, otherwise `False` is + returned. Raises: - EquivalenceError: if `raise_ == True` and the objects are not equivalent. + EquivalenceError: if `raise_ == True` and the objects are not + equivalent. Returns: bool describing result of equivalence comparison. @@ -93,9 +92,4 @@ def isequivalent(self, other: Self, raise_: bool = False) -> bool: class EquivalenceError(TypeError, ValueError): - """Raised if objects are not equivalent. - - Equivalence in this case means that objects are equal in all respects, - except for data content. Generally data loaded from the same source with - identical preprocessing will be equivalent. - """ + """Raised if objects are not equivalent."""