Skip to content

Commit

Permalink
docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniBodor committed Feb 2, 2024
1 parent a5b5d10 commit 44c5504
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions eitprocessing/mixins/equality.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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."""

0 comments on commit 44c5504

Please sign in to comment.