From ea083c753a9253f7ffc9056ba9ed6415abf3df5f Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Tue, 14 Sep 2021 02:19:58 +0100 Subject: [PATCH] misc fixes --- .github/workflows/test.yml | 4 ++-- scripts/amypet_gif.py | 6 +++--- setup.cfg | 3 ++- tests/test_gif.py | 1 + tests/test_imtrimup.py | 1 + 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dba0d47f..b5395e6c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,7 @@ jobs: - run: pre-commit run -a --show-diff-on-failure test: if: github.event_name != 'pull_request' || github.head_ref != 'devel' - runs-on: [self-hosted, python] + runs-on: [self-hosted, python, cuda] timeout-minutes: 4320 strategy: matrix: @@ -51,7 +51,7 @@ jobs: - name: Run setup-python run: setup-python -p${{ matrix.python }} miutil scikit-build cmake ninja - name: Install - run: pip install -U --no-binary nimpa "git+git://github.com/AMYPAD/miutil@devel#egg=miutil" "git+git://github.com/AMYPAD/NiftyPAD@master#egg=niftypad" -e .[dev,gif] + run: pip install -U --no-binary nimpa,nipet "git+git://github.com/AMYPAD/NiftyPAD@master#egg=niftypad" "git+git://github.com/NiftyPET/NIMPA@devel#egg=nimpa" "git+git://github.com/NiftyPET/NIPET@devel#egg=nipet" -e .[dev,gif,imtrimup] - run: pytest - run: codecov - name: Post Run setup-python diff --git a/scripts/amypet_gif.py b/scripts/amypet_gif.py index a832f8b5..3f66ca4b 100644 --- a/scripts/amypet_gif.py +++ b/scripts/amypet_gif.py @@ -67,12 +67,12 @@ def main(argv=None): `pip install SimpleITK`""" ) ) - elif len(fn4b) >= 1: + else: if len(fn4b) > 1: log.warning("%d inputs found, selecting latest") - fingif = nsort(fn4b)[-1] + fingif = nsort(list(map(str, fn4b)))[-1] log.debug("found N4-bias corrected:%s", fingif) - if len(fgif) != 0 or not args.overwrite_existing: + if fgif and not args.overwrite_existing: log.warning("skipping") continue diff --git a/setup.cfg b/setup.cfg index bc61e14e..932f0e13 100644 --- a/setup.cfg +++ b/setup.cfg @@ -61,9 +61,10 @@ niftypet=niftypet>=0.0.1 niftypad= gif= argopt - miutil>0.8.0 + miutil>=0.9.0 nimpa SimpleITK>=1.2.0,<2 +imtrimup=nipet [options.entry_points] console_scripts= amypad=amypad.cli:main diff --git a/tests/test_gif.py b/tests/test_gif.py index 13cde1e4..0a064b54 100644 --- a/tests/test_gif.py +++ b/tests/test_gif.py @@ -20,6 +20,7 @@ def test_gif(fimin): else: fin = fimin + print(fin) gif.run(fin, outpath=outpath / "GIF") diff --git a/tests/test_imtrimup.py b/tests/test_imtrimup.py index 46b10c45..1aba8030 100644 --- a/tests/test_imtrimup.py +++ b/tests/test_imtrimup.py @@ -57,6 +57,7 @@ def dyndir(datain, mMRpars): return Path(opth) / "PET" / "multiple-frames" +@pytest.mark.timeout(60 * 60) def test_rectrim(dyndir): rectrim = pytest.importorskip("amypad.rectrim") rectrim.run(dyndir)