From 105c2987de4847b71eaf7b88a224dc5d6c47b715 Mon Sep 17 00:00:00 2001 From: Murat Bilgel Date: Wed, 4 Sep 2024 18:09:49 -0400 Subject: [PATCH 1/2] fix nibabel dataobj access for speed up; enable nesma test --- src/dynamicpet/temporalobject/temporalimage.py | 2 +- tests/test_main.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/dynamicpet/temporalobject/temporalimage.py b/src/dynamicpet/temporalobject/temporalimage.py index 3f0a565..980d68f 100644 --- a/src/dynamicpet/temporalobject/temporalimage.py +++ b/src/dynamicpet/temporalobject/temporalimage.py @@ -81,7 +81,7 @@ def __init__( @property def dataobj(self) -> NDArray[np.double]: """Get dataobj of image.""" - return np.asarray(self.img.dataobj, dtype=np.double) + return self.img.get_fdata() # np.asarray(self.img.dataobj, dtype=np.double) @property def num_voxels(self) -> int: diff --git a/tests/test_main.py b/tests/test_main.py index 62bc406..899ea70 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -146,7 +146,6 @@ def test_denoise_hyprlr(images: dict[str, Path]) -> None: assert os.path.isfile(outputdir / "pet_hyprlr.json") -@pytest.mark.skip(reason="current NESMA implementation is too slow") def test_denoise_nesma(images: dict[str, Path]) -> None: """Test denoise in __main__.py.""" from dynamicpet.__main__ import denoise From 25f68c669a20ce8b24542981684114f1789069db Mon Sep 17 00:00:00 2001 From: Murat Bilgel Date: Wed, 4 Sep 2024 21:19:32 -0400 Subject: [PATCH 2/2] ignore jinja2 safety issue --- noxfile.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index 5221f27..d0bdb3e 100644 --- a/noxfile.py +++ b/noxfile.py @@ -143,7 +143,14 @@ def safety(session: Session) -> None: """Scan dependencies for insecure packages.""" requirements = session.poetry.export_requirements() session.install("safety") - session.run("safety", "check", "--full-report", f"--file={requirements}") + session.run( + "safety", + "check", + "--full-report", + f"--file={requirements}", + "--ignore", + "70612", + ) @session(python=python_versions)