diff --git a/CITATION.cff b/CITATION.cff index 434fb880b..ad7f47b22 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -39,7 +39,7 @@ authors: date-released: 2023-03-23 doi: 10.5281/zenodo.7869553 -version: "1.8.3" +version: "1.8.4" repository-code: "https://github.com/EIT-ALIVE/eitprocessing" keywords: - Mechanical lung ventilation diff --git a/eitprocessing/__init__.py b/eitprocessing/__init__.py index a44132de1..22944760c 100644 --- a/eitprocessing/__init__.py +++ b/eitprocessing/__init__.py @@ -1 +1 @@ -__version__ = "1.8.3" +__version__ = "1.8.4" diff --git a/eitprocessing/datahandling/eitdata.py b/eitprocessing/datahandling/eitdata.py index 0af2f2133..6b4930ab6 100644 --- a/eitprocessing/datahandling/eitdata.py +++ b/eitprocessing/datahandling/eitdata.py @@ -2,12 +2,11 @@ import warnings from dataclasses import InitVar, dataclass, field -from enum import auto +from enum import Enum from pathlib import Path from typing import TYPE_CHECKING, Any, TypeVar import numpy as np -from strenum import LowercaseStrEnum # TODO: EOL 3.10: replace with native StrEnum from eitprocessing.datahandling import DataContainer from eitprocessing.datahandling.continuousdata import ContinuousData @@ -173,12 +172,28 @@ def calculate_global_impedance(self) -> np.ndarray: return np.nansum(self.pixel_impedance, axis=(1, 2)) -class Vendor(LowercaseStrEnum): - """Enum indicating the vendor (manufacturer) of the source EIT device.""" +class Vendor(Enum): + """Enum indicating the vendor (manufacturer) of the source EIT device. + + The enum values are all lowercase strings. For some manufacturers, multiple ways of wrinting are provided mapping to + the same value, to prevent confusion over conversion of special characters. The "simulated" vendor is provided to + indicate simulated data. + """ + + DRAEGER = "draeger" + """Dräger (PulmoVista V500)""" + + TIMPEL = "timpel" + """Timpel (Enlight 2100)""" + + SENTEC = "sentec" + """Sentec (Lumon)""" - DRAEGER = auto() - TIMPEL = auto() - SENTEC = auto() DRAGER = DRAEGER - DRÄGER = DRAEGER # noqa: PLC2401 - SIMULATED = auto() + """Synonym of DRAEGER""" + + DRÄGER = DRAEGER # noqa: PIE796, PLC2401 + """Synonym of DRAEGER""" + + SIMULATED = "simulated" + """Simulated data""" diff --git a/eitprocessing/roi/watershed.py b/eitprocessing/roi/watershed.py index 6b27769c6..3820bbed5 100644 --- a/eitprocessing/roi/watershed.py +++ b/eitprocessing/roi/watershed.py @@ -168,7 +168,7 @@ def apply( # noqa: PLR0915 included_marker_indices = np.isin(peaks_loc_int, markers_inside_tiv_mask) included_peaks = np.argwhere(included_marker_indices) - excluded_peaks = np.argwhere(~included_marker_indices) + excluded_peaks = np.argwhere(peaks_loc_bool & ~included_marker_indices) included_watershed_regions = np.where(included_region, watershed_regions, np.nan) diff --git a/pyproject.toml b/pyproject.toml index f807f3562..30bfdc7a3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "eitprocessing" -version = "1.8.3" +version = "1.8.4" description = "Processing of lung image data from electrical impedance tomography." readme = "README.md" requires-python = ">=3.10" @@ -40,7 +40,6 @@ dependencies = [ "matplotlib>=3.10", "numpy >= 1.24.2", "scipy >= 1.10.1", - "strenum >= 0.4.10", "anytree >= 2.12.1 ", "typing_extensions", "pyyaml", @@ -174,7 +173,7 @@ isort.known-first-party = ["eitprocessing"] "docs/*" = ["ALL"] [tool.bumpversion] -current_version = "1.8.3" +current_version = "1.8.4" [[tool.bumpversion.files]] filename = "pyproject.toml" diff --git a/tests/test_watershed.py b/tests/test_watershed.py index abf76b3fb..ec7680bce 100644 --- a/tests/test_watershed.py +++ b/tests/test_watershed.py @@ -159,6 +159,8 @@ def test_watershed_captures(draeger1: Sequence): ]: assert key in captures, f"captures should have a '{key}' entry" + assert len(captures["local peaks"]) == len(captures["included peaks"]) + len(captures["excluded peaks"]) + def test_watershed_no_amplitude(): eit_data = EITData(