From fb04e5d26b73c25bad830ac73b4ef6589776adc1 Mon Sep 17 00:00:00 2001 From: bpinsard Date: Wed, 15 May 2024 14:05:53 -0400 Subject: [PATCH] fix rebase mess --- niworkflows/interfaces/gradunwarp.py | 11 ++++++++++- niworkflows/interfaces/tests/test_bids.py | 4 ---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/niworkflows/interfaces/gradunwarp.py b/niworkflows/interfaces/gradunwarp.py index 61652be208b..553c8d5e6eb 100644 --- a/niworkflows/interfaces/gradunwarp.py +++ b/niworkflows/interfaces/gradunwarp.py @@ -29,6 +29,13 @@ SimpleInterface ) +has_gradunwarp = False +try: + from gradunwarp.core.gradient_unwarp import GradientUnwarpRunner + has_gradunwarp = True +except ImportError: + pass + class _GradUnwarpInputSpec(TraitedSpec): infile = File(exists=True, mandatory=True, desc="input image to be corrected") @@ -63,7 +70,9 @@ class GradUnwarp(SimpleInterface): def _run_interface(self, runtime): - from gradunwarp.core.gradient_unwarp import GradientUnwarpRunner + if not has_gradunwarp: + raise RuntimeError('missing gradunwarp dependency') + gur = GradientUnwarpRunner(self.inputs) gur.run() gur.write() diff --git a/niworkflows/interfaces/tests/test_bids.py b/niworkflows/interfaces/tests/test_bids.py index 007c943d60e..365a62356a8 100644 --- a/niworkflows/interfaces/tests/test_bids.py +++ b/niworkflows/interfaces/tests/test_bids.py @@ -300,11 +300,7 @@ def test_DerivativesDataSink_build_path( **entities, ) -<<<<<<< HEAD if isinstance(expectation, type): -======= - if type(expectation) is type(Exception): ->>>>>>> 601d1d1f (fix flake8 tests) with pytest.raises(expectation): dds.run() return