Skip to content

Commit 3281689

Browse files
committed
debugged automated tests
1 parent 5402966 commit 3281689

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.venv
1+
.venv*
22
/.project
33
/.pydevproject
44
*.pyc

example-specs/task/ants_n4_bias_field_correction.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ tests:
164164
dimension: '3'
165165
input_image:
166166
bspline_fitting_distance: '300'
167+
save_bias: 'False'
168+
copy_header: 'False'
167169
shrink_factor: '3'
168170
n_iterations: '[50,50,30,20]'
169171
imports: &id001
@@ -186,6 +188,10 @@ tests:
186188
# dict[str, str] - values to provide to inputs fields in the task initialisation
187189
# (if not specified, will try to choose a sensible value)
188190
convergence_threshold: 1e-6
191+
n_iterations: '[50,50,30,20]'
192+
input_image:
193+
save_bias: 'False'
194+
copy_header: 'False'
189195
imports:
190196
# list[nipype2pydra.task.importstatement] - list import statements required by the test, with each list item
191197
# consisting of 'module', 'name', and optionally 'alias' keys
@@ -205,6 +211,10 @@ tests:
205211
# dict[str, str] - values to provide to inputs fields in the task initialisation
206212
# (if not specified, will try to choose a sensible value)
207213
bspline_order: '5'
214+
bspline_fitting_distance: 10
215+
save_bias: 'False'
216+
copy_header: 'False'
217+
input_image:
208218
imports:
209219
# list[nipype2pydra.task.importstatement] - list import statements required by the test, with each list item
210220
# consisting of 'module', 'name', and optionally 'alias' keys
@@ -225,6 +235,7 @@ tests:
225235
# (if not specified, will try to choose a sensible value)
226236
input_image:
227237
save_bias: 'True'
238+
copy_header: 'False'
228239
dimension: '3'
229240
imports:
230241
# list[nipype2pydra.task.importstatement] - list import statements required by the test, with each list item
@@ -247,6 +258,8 @@ tests:
247258
input_image:
248259
dimension: '3'
249260
histogram_sharpening: (0.12, 0.02, 200)
261+
save_bias: 'False'
262+
copy_header: 'False'
250263
imports:
251264
# list[nipype2pydra.task.importstatement] - list import statements required by the test, with each list item
252265
# consisting of 'module', 'name', and optionally 'alias' keys
@@ -274,6 +287,8 @@ doctests:
274287
bspline_fitting_distance: '300'
275288
shrink_factor: '3'
276289
n_iterations: '[50,50,30,20]'
290+
save_bias: 'False'
291+
copy_header: 'False'
277292
imports: *id001
278293
# list[nipype2pydra.task.importstatement] - list import statements required by the test, with each list item
279294
# consisting of 'module', 'name', and optionally 'alias' keys
@@ -286,6 +301,9 @@ doctests:
286301
# If the field is of file-format type and the value is None, then the
287302
# '.mock()' method of the corresponding class is used instead.
288303
convergence_threshold: 1e-6
304+
n_iterations: '[50,50,30,20]'
305+
save_bias: 'False'
306+
copy_header: 'False'
289307
imports:
290308
# list[nipype2pydra.task.importstatement] - list import statements required by the test, with each list item
291309
# consisting of 'module', 'name', and optionally 'alias' keys
@@ -298,6 +316,8 @@ doctests:
298316
# If the field is of file-format type and the value is None, then the
299317
# '.mock()' method of the corresponding class is used instead.
300318
bspline_order: '5'
319+
save_bias: 'False'
320+
copy_header: 'False'
301321
imports:
302322
# list[nipype2pydra.task.importstatement] - list import statements required by the test, with each list item
303323
# consisting of 'module', 'name', and optionally 'alias' keys
@@ -311,6 +331,7 @@ doctests:
311331
# '.mock()' method of the corresponding class is used instead.
312332
input_image:
313333
save_bias: 'True'
334+
copy_header: 'False'
314335
dimension: '3'
315336
imports:
316337
# list[nipype2pydra.task.importstatement] - list import statements required by the test, with each list item
@@ -324,6 +345,8 @@ doctests:
324345
# If the field is of file-format type and the value is None, then the
325346
# '.mock()' method of the corresponding class is used instead.
326347
input_image:
348+
save_bias: 'False'
349+
copy_header: 'False'
327350
dimension: '3'
328351
histogram_sharpening: (0.12, 0.02, 200)
329352
imports:

nipype2pydra/utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
from pathlib import Path
99
from fileformats.core import FileSet
1010

11+
try:
12+
from typing import GenericAlias
13+
except ImportError:
14+
from typing import _GenericAlias as GenericAlias
15+
1116
from importlib import import_module
1217

1318

@@ -70,7 +75,7 @@ def add_to_sys_path(path: Path):
7075
def is_fileset(tp: type):
7176
return (
7277
inspect.isclass(tp)
73-
and type(tp) is not ty.GenericAlias
78+
and type(tp) is not GenericAlias
7479
and issubclass(tp, FileSet)
7580
)
7681

0 commit comments

Comments
 (0)