Skip to content

Commit 77a7d7f

Browse files
committed
debugged N4BiasFieldCorrection
1 parent c1516a5 commit 77a7d7f

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

nipype2pydra/task.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,8 @@ def types_to_names(spec_fields):
311311
spec_str += f" output_spec = {self.task_name}_output_spec\n"
312312
spec_str += f" executable='{self.nipype_interface._cmd}'\n"
313313

314-
for tp_repl in self.TYPE_REPLACE:
315-
spec_str = spec_str.replace(*tp_repl)
314+
# for tp_repl in self.TYPE_REPLACE:
315+
# spec_str = spec_str.replace(*tp_repl)
316316

317317
spec_str_black = black.format_file_contents(
318318
spec_str, fast=False, mode=black.FileMode()

pytest.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[pytest]
2+
addopts = -s

tests/test_task.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@
55
from nipype2pydra.utils import import_module_from_path
66

77

8+
INBUILT_NIPYPE_TRAIT_NAMES = [
9+
"__all__",
10+
"args",
11+
"trait_added",
12+
"trait_modified",
13+
"environ",
14+
"environ_items",
15+
]
16+
17+
818
def test_task_conversion(task_spec_file, cli_runner, work_dir):
919

1020
with open(task_spec_file) as f:
@@ -27,4 +37,15 @@ def test_task_conversion(task_spec_file, cli_runner, work_dir):
2737
import_module(task_spec["nipype_module"]), task_spec["task_name"]
2838
)
2939

30-
assert sorted(f[0] for f in pydra_task.input_spec.fields) == sorted(nipype_interface.input_spec().all_trait_names())
40+
nipype_trait_names = nipype_interface.input_spec().all_trait_names()
41+
42+
assert sorted(f[0] for f in pydra_task.input_spec.fields) == sorted(
43+
n
44+
for n in nipype_trait_names
45+
if not (
46+
n in INBUILT_NIPYPE_TRAIT_NAMES
47+
or (n.endswith("_items") and n[:-len("_items")] in nipype_trait_names)
48+
)
49+
)
50+
51+
# TODO: More detailed tests needed here

0 commit comments

Comments
 (0)