Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
psomhorst committed Dec 18, 2024
2 parents 43c1aa2 + ad0bbdb commit 6ad680f
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ authors:

date-released: 2023-03-23
doi: 10.5281/zenodo.7869553
version: "1.4.7"
version: "1.4.8"
repository-code: "https://github.com/EIT-ALIVE/eitprocessing"
keywords:
- Mechanical lung ventilation
Expand Down
2 changes: 1 addition & 1 deletion eitprocessing/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.4.7"
__version__ = "1.4.8"
3 changes: 3 additions & 0 deletions eitprocessing/datahandling/loading/draeger.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ def load_from_single_path(
msg = "No sample frequency provided. "
raise ValueError(msg)

# time wraps around the number of seconds in a day
time = np.unwrap(time, period=24 * 60 * 60)

eit_data = EITData(
vendor=Vendor.DRAEGER,
path=path,
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "eitprocessing"
version = "1.4.7"
version = "1.4.8"
description = "Processing of lung image data from electrical impedance tomography."
readme = "README.md"
requires-python = ">=3.10"
Expand Down Expand Up @@ -173,7 +173,7 @@ isort.known-first-party = ["eitprocessing"]
"docs/*" = ["ALL"]

[tool.bumpversion]
current_version = "1.4.7"
current_version = "1.4.8"

[[tool.bumpversion.files]]
filename = "pyproject.toml"
Expand Down
8 changes: 8 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
draeger_file1 = data_directory / "Draeger_Test3.bin"
draeger_file2 = data_directory / "Draeger_Test.bin"
draeger_file3 = data_directory / "Draeger_Test_event_on_first_frame.bin"
draeger_wrapped_time_axis_file = data_directory / "Draeger_wrapped_time_axis.bin"
timpel_file = data_directory / "Timpel_test.txt"
dummy_file = data_directory / "not_a_file.dummy"

Expand All @@ -39,6 +40,13 @@ def timpel1():
return load_eit_data(timpel_file, vendor="timpel", label="timpel")


@pytest.fixture(scope="session")
def draeger_wrapped_time_axis():
return load_eit_data(
draeger_wrapped_time_axis_file, vendor="draeger", sample_frequency=20, label="draeger_wrapped_time_axis"
)


# @pytest.fixture(scope="session")
# def timpel_double():
# return load_eit_data([timpel_file, timpel_file], vendor="timpel", label="timpel_double")
8 changes: 8 additions & 0 deletions tests/test_loading.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import numpy as np
import pytest

from eitprocessing.datahandling.eitdata import EITData, Vendor
Expand Down Expand Up @@ -145,3 +146,10 @@ def test_event_on_first_frame(draeger2: Sequence):
draeger3_events = draeger3.sparse_data["events_(draeger)"]
assert draeger3_events == draeger2.sparse_data["events_(draeger)"]
assert draeger3_events.time[0] == draeger3.eit_data["raw"].time[0]


@pytest.mark.parametrize("fixture_name", ["draeger1", "draeger2", "draeger_wrapped_time_axis"])
def test_time_axis(fixture_name: str, request: pytest.FixtureRequest):
sequence = request.getfixturevalue(fixture_name)
time_diff = np.diff(sequence.time)
assert np.allclose(time_diff, time_diff.mean())

0 comments on commit 6ad680f

Please sign in to comment.