From d83703810894325b101548086a0781b7936c4ecf Mon Sep 17 00:00:00 2001 From: Steven Tilley Date: Thu, 13 Jun 2019 16:33:38 -0400 Subject: [PATCH 1/3] Check that file exists in basedir, not current dir Addresses #2944 --- nipype/pipeline/engine/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nipype/pipeline/engine/utils.py b/nipype/pipeline/engine/utils.py index 3d961126d5..76f3972286 100644 --- a/nipype/pipeline/engine/utils.py +++ b/nipype/pipeline/engine/utils.py @@ -486,7 +486,7 @@ def modify_paths(object, relative=True, basedir=None): out = tuple(out) else: if isdefined(object): - if isinstance(object, (str, bytes)) and os.path.isfile(object): + if isinstance(object, (str, bytes)) and os.path.isfile(os.path.join(basedir, object)): if relative: if config.getboolean('execution', 'use_relative_paths'): out = relpath(object, start=basedir) From 6df68c4259157d69ef486390e2d5adc6b9af00d9 Mon Sep 17 00:00:00 2001 From: Steven Tilley Date: Thu, 13 Jun 2019 17:07:00 -0400 Subject: [PATCH 2/3] add info to .zenodo.json --- .zenodo.json | 6 +++++ nipype/algorithms/tests/test_auto_ACompCor.py | 4 ++-- nipype/algorithms/tests/test_auto_TCompCor.py | 4 ++-- nipype/interfaces/afni/tests/test_auto_Cat.py | 7 +++--- .../interfaces/ants/tests/test_auto_ANTS.py | 4 ++-- .../ants/tests/test_auto_AntsJointFusion.py | 9 ++++---- .../ants/tests/test_auto_Atropos.py | 4 ++-- nipype/interfaces/base/core.py | 4 ++-- .../fsl/tests/test_auto_AccuracyTester.py | 9 ++++---- .../fsl/tests/test_auto_FeatureExtractor.py | 11 +++++----- .../fsl/tests/test_auto_TrainingSetCreator.py | 22 +++++++++---------- .../spm/tests/test_auto_Level1Design.py | 1 + 12 files changed, 43 insertions(+), 42 deletions(-) diff --git a/.zenodo.json b/.zenodo.json index a7333e6ec4..b3b0c58c73 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -677,6 +677,12 @@ "name": "Ghosh, Satrajit", "orcid": "0000-0002-5312-6729" } + { + "affiliation": "Holland Bloorview Kids Rehabilitation Hospital", + "name": "Tilley II, Steven", + "orcid": "0000-0003-4853-5082" + } + ], "keywords": [ "neuroimaging", diff --git a/nipype/algorithms/tests/test_auto_ACompCor.py b/nipype/algorithms/tests/test_auto_ACompCor.py index 95a9f51a88..e28c77d467 100644 --- a/nipype/algorithms/tests/test_auto_ACompCor.py +++ b/nipype/algorithms/tests/test_auto_ACompCor.py @@ -25,8 +25,8 @@ def test_ACompCor_inputs(): realigned_file=dict(mandatory=True, ), regress_poly_degree=dict(usedefault=True, ), repetition_time=dict(), - save_metadata=dict(), - save_pre_filter=dict(), + save_metadata=dict(usedefault=True, ), + save_pre_filter=dict(usedefault=True, ), use_regress_poly=dict( deprecated='0.15.0', new_name='pre_filter', diff --git a/nipype/algorithms/tests/test_auto_TCompCor.py b/nipype/algorithms/tests/test_auto_TCompCor.py index 1e94ef4241..c3bdcac192 100644 --- a/nipype/algorithms/tests/test_auto_TCompCor.py +++ b/nipype/algorithms/tests/test_auto_TCompCor.py @@ -26,8 +26,8 @@ def test_TCompCor_inputs(): realigned_file=dict(mandatory=True, ), regress_poly_degree=dict(usedefault=True, ), repetition_time=dict(), - save_metadata=dict(), - save_pre_filter=dict(), + save_metadata=dict(usedefault=True, ), + save_pre_filter=dict(usedefault=True, ), use_regress_poly=dict( deprecated='0.15.0', new_name='pre_filter', diff --git a/nipype/interfaces/afni/tests/test_auto_Cat.py b/nipype/interfaces/afni/tests/test_auto_Cat.py index 3da86c66d6..051734ee82 100644 --- a/nipype/interfaces/afni/tests/test_auto_Cat.py +++ b/nipype/interfaces/afni/tests/test_auto_Cat.py @@ -21,10 +21,9 @@ def test_Cat_inputs(): usedefault=True, ), omitconst=dict(argstr='-nonconst', ), - out_cint=dict( - xor=[ - 'out_format', 'out_nice', 'out_double', 'out_fint', 'out_int' - ], ), + out_cint=dict(xor=[ + 'out_format', 'out_nice', 'out_double', 'out_fint', 'out_int' + ], ), out_double=dict( argstr='-d', xor=['out_format', 'out_nice', 'out_int', 'out_fint', 'out_cint'], diff --git a/nipype/interfaces/ants/tests/test_auto_ANTS.py b/nipype/interfaces/ants/tests/test_auto_ANTS.py index 7c7ef6682c..976984c35a 100644 --- a/nipype/interfaces/ants/tests/test_auto_ANTS.py +++ b/nipype/interfaces/ants/tests/test_auto_ANTS.py @@ -57,8 +57,8 @@ def test_ANTS_inputs(): regularization=dict(argstr='%s', ), regularization_deformation_field_sigma=dict( requires=['regularization'], ), - regularization_gradient_field_sigma=dict( - requires=['regularization'], ), + regularization_gradient_field_sigma=dict(requires=['regularization' + ], ), smoothing_sigmas=dict( argstr='--gaussian-smoothing-sigmas %s', sep='x', diff --git a/nipype/interfaces/ants/tests/test_auto_AntsJointFusion.py b/nipype/interfaces/ants/tests/test_auto_AntsJointFusion.py index 341f250a2c..2520d7caa1 100644 --- a/nipype/interfaces/ants/tests/test_auto_AntsJointFusion.py +++ b/nipype/interfaces/ants/tests/test_auto_AntsJointFusion.py @@ -41,11 +41,10 @@ def test_AntsJointFusion_inputs(): nohash=True, usedefault=True, ), - out_atlas_voting_weight_name_format=dict( - requires=[ - 'out_label_fusion', 'out_intensity_fusion_name_format', - 'out_label_post_prob_name_format' - ], ), + out_atlas_voting_weight_name_format=dict(requires=[ + 'out_label_fusion', 'out_intensity_fusion_name_format', + 'out_label_post_prob_name_format' + ], ), out_intensity_fusion_name_format=dict(argstr='', ), out_label_fusion=dict( argstr='%s', diff --git a/nipype/interfaces/ants/tests/test_auto_Atropos.py b/nipype/interfaces/ants/tests/test_auto_Atropos.py index 90bc13778a..7fb146e928 100644 --- a/nipype/interfaces/ants/tests/test_auto_Atropos.py +++ b/nipype/interfaces/ants/tests/test_auto_Atropos.py @@ -51,8 +51,8 @@ def test_Atropos_inputs(): prior_probability_threshold=dict(requires=['prior_weighting'], ), prior_weighting=dict(), save_posteriors=dict(), - use_mixture_model_proportions=dict( - requires=['posterior_formulation'], ), + use_mixture_model_proportions=dict(requires=['posterior_formulation' + ], ), use_random_seed=dict( argstr='--use-random-seed %d', usedefault=True, diff --git a/nipype/interfaces/base/core.py b/nipype/interfaces/base/core.py index 77ab6cf398..a7f0e9b9ff 100644 --- a/nipype/interfaces/base/core.py +++ b/nipype/interfaces/base/core.py @@ -203,10 +203,10 @@ def _check_requires(self, spec, name, value): ] if any(values) and isdefined(value): if len(values) > 1: - fmt = ("%s requires values for inputs %s because '%s' is set. " + fmt = ("%s requires values for inputs %s because '%s' is set. " "For a list of required inputs, see %s.help()") else: - fmt = ("%s requires a value for input %s because '%s' is set. " + fmt = ("%s requires a value for input %s because '%s' is set. " "For a list of required inputs, see %s.help()") msg = fmt % (self.__class__.__name__, ', '.join("'%s'" % req for req in spec.requires), diff --git a/nipype/interfaces/fsl/tests/test_auto_AccuracyTester.py b/nipype/interfaces/fsl/tests/test_auto_AccuracyTester.py index 062d6367f7..d28d3e5d93 100644 --- a/nipype/interfaces/fsl/tests/test_auto_AccuracyTester.py +++ b/nipype/interfaces/fsl/tests/test_auto_AccuracyTester.py @@ -33,11 +33,10 @@ def test_AccuracyTester_inputs(): for metakey, value in list(metadata.items()): assert getattr(inputs.traits()[key], metakey) == value def test_AccuracyTester_outputs(): - output_map = dict( - output_directory=dict( - argstr='%s', - position=1, - ), ) + output_map = dict(output_directory=dict( + argstr='%s', + position=1, + ), ) outputs = AccuracyTester.output_spec() for key, metadata in list(output_map.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_FeatureExtractor.py b/nipype/interfaces/fsl/tests/test_auto_FeatureExtractor.py index 3945c40a87..eaeeb34ce8 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FeatureExtractor.py +++ b/nipype/interfaces/fsl/tests/test_auto_FeatureExtractor.py @@ -22,12 +22,11 @@ def test_FeatureExtractor_inputs(): for metakey, value in list(metadata.items()): assert getattr(inputs.traits()[key], metakey) == value def test_FeatureExtractor_outputs(): - output_map = dict( - mel_ica=dict( - argstr='%s', - copyfile=False, - position=-1, - ), ) + output_map = dict(mel_ica=dict( + argstr='%s', + copyfile=False, + position=-1, + ), ) outputs = FeatureExtractor.output_spec() for key, metadata in list(output_map.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_TrainingSetCreator.py b/nipype/interfaces/fsl/tests/test_auto_TrainingSetCreator.py index 18ef078a79..638bcdd156 100644 --- a/nipype/interfaces/fsl/tests/test_auto_TrainingSetCreator.py +++ b/nipype/interfaces/fsl/tests/test_auto_TrainingSetCreator.py @@ -4,24 +4,22 @@ def test_TrainingSetCreator_inputs(): - input_map = dict( - mel_icas_in=dict( - argstr='%s', - copyfile=False, - position=-1, - ), ) + input_map = dict(mel_icas_in=dict( + argstr='%s', + copyfile=False, + position=-1, + ), ) inputs = TrainingSetCreator.input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): assert getattr(inputs.traits()[key], metakey) == value def test_TrainingSetCreator_outputs(): - output_map = dict( - mel_icas_out=dict( - argstr='%s', - copyfile=False, - position=-1, - ), ) + output_map = dict(mel_icas_out=dict( + argstr='%s', + copyfile=False, + position=-1, + ), ) outputs = TrainingSetCreator.output_spec() for key, metadata in list(output_map.items()): diff --git a/nipype/interfaces/spm/tests/test_auto_Level1Design.py b/nipype/interfaces/spm/tests/test_auto_Level1Design.py index 7ad8ab8195..7dce3dda2a 100644 --- a/nipype/interfaces/spm/tests/test_auto_Level1Design.py +++ b/nipype/interfaces/spm/tests/test_auto_Level1Design.py @@ -10,6 +10,7 @@ def test_Level1Design_inputs(): mandatory=True, ), factor_info=dict(field='fact', ), + flags=dict(), global_intensity_normalization=dict(field='global', ), interscan_interval=dict( field='timing.RT', From 2e95a8be11549fc9a7610abc88f6e4655b28db14 Mon Sep 17 00:00:00 2001 From: Steven Tilley Date: Thu, 13 Jun 2019 17:34:05 -0400 Subject: [PATCH 3/3] add missing comma --- .zenodo.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.zenodo.json b/.zenodo.json index b3b0c58c73..07b38261f1 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -676,7 +676,7 @@ "affiliation": "MIT, HMS", "name": "Ghosh, Satrajit", "orcid": "0000-0002-5312-6729" - } + }, { "affiliation": "Holland Bloorview Kids Rehabilitation Hospital", "name": "Tilley II, Steven",