From 4afb000faa5baa67e8f7ee9659ebc270b9560211 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 9 Mar 2023 11:38:11 -0500 Subject: [PATCH 01/33] Add github action to codespell master on push and PRs --- .github/workflows/codespell.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/codespell.yml diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 0000000000..5768d7c636 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,19 @@ +--- +name: Codespell + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Codespell + uses: codespell-project/actions-codespell@v1 From 8d8ef535c83bd97de14f167226b9e1bd91b062c6 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 9 Mar 2023 11:38:11 -0500 Subject: [PATCH 02/33] Add rudimentary .codespellrc --- .codespellrc | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .codespellrc diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000000..5aa4b5e75b --- /dev/null +++ b/.codespellrc @@ -0,0 +1,3 @@ +[codespell] +skip = .git,*.pdf,*.svg +# ignore-words-list = From 912c700ff8b8be144fb4c8ca7fcf235440640281 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 9 Mar 2023 11:40:24 -0500 Subject: [PATCH 03/33] custom skips --- .codespellrc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.codespellrc b/.codespellrc index 5aa4b5e75b..46ed8000f6 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,3 +1,6 @@ [codespell] -skip = .git,*.pdf,*.svg -# ignore-words-list = +skip = .git,*.pdf,*.svg,external +# nd - import module short +# fith - oddness coming from AFNI +# whos - smth used in matlab things +ignore-words-list = te,inport,objekt,jist,nd,hel,inout,fith,whos,fot,ue,shs From 761b620d7a3af3c3711678c1ea1c967b33fde1d5 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 9 Mar 2023 11:41:53 -0500 Subject: [PATCH 04/33] [DATALAD RUNCMD] rename hasnt var into hasnot to make codespell happier === Do not change lines below === { "chain": [], "cmd": "git-sedi hasnt hasnot", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- nipype/interfaces/base/tests/test_core.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nipype/interfaces/base/tests/test_core.py b/nipype/interfaces/base/tests/test_core.py index cdfef51193..0c3f5a8dc1 100644 --- a/nipype/interfaces/base/tests/test_core.py +++ b/nipype/interfaces/base/tests/test_core.py @@ -288,28 +288,28 @@ class WithoutInput(WithInput): _version = "0.6" has = WithInput() - hasnt = WithoutInput() + hasnot = WithoutInput() trying_anyway = WithoutInput(foo=3) assert has.inputs.foo == 3 - assert not nib.isdefined(hasnt.inputs.foo) + assert not nib.isdefined(hasnot.inputs.foo) assert trying_anyway.inputs.foo == 3 has.run() - hasnt.run() + hasnot.run() with pytest.raises(Exception): trying_anyway.run() # Still settable has.inputs.foo = 4 - hasnt.inputs.foo = 4 + hasnot.inputs.foo = 4 trying_anyway.inputs.foo = 4 assert has.inputs.foo == 4 - assert hasnt.inputs.foo == 4 + assert hasnot.inputs.foo == 4 assert trying_anyway.inputs.foo == 4 has.run() with pytest.raises(Exception): - hasnt.run() + hasnot.run() with pytest.raises(Exception): trying_anyway.run() From f6965c85bbadddaf6a7677ffbda56b3c02cf1c9c Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 9 Mar 2023 11:46:46 -0500 Subject: [PATCH 05/33] Some ambigous typos fixes --- doc/changelog/0.X.X-changelog.rst | 2 +- nipype/interfaces/io.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/changelog/0.X.X-changelog.rst b/doc/changelog/0.X.X-changelog.rst index 0c007cade7..8780afef84 100644 --- a/doc/changelog/0.X.X-changelog.rst +++ b/doc/changelog/0.X.X-changelog.rst @@ -316,7 +316,7 @@ Release 0.10.0 (October 10, 2014) * ENH: Updated FSL interfaces: BEDPOSTX and XFibres, former interfaces are still available with the version suffix: BEDPOSTX4 and XFibres4. Added gpu versions of BEDPOSTX: BEDPOSTXGPU, BEDPOSTX5GPU, and BEDPOSTX4GPU -* ENH: Added experimental support for MIPAV algorithms thorugh JIST plugins +* ENH: Added experimental support for MIPAV algorithms through JIST plugins * ENH: New dipy interfaces: Denoise, Resample * ENH: New Freesurfer interfaces: Tkregister2 (for conversion of fsl style matrices to freesurfer format), MRIPretess * ENH: New FSL interfaces: WarpPoints, WarpPointsToStd, EpiReg, ProbTrackX2, WarpUtils, ConvertWarp diff --git a/nipype/interfaces/io.py b/nipype/interfaces/io.py index ea06482500..7cae487abc 100644 --- a/nipype/interfaces/io.py +++ b/nipype/interfaces/io.py @@ -1683,7 +1683,7 @@ class FSSourceOutputSpec(TraitedSpec): File(exists=True), desc="Inflated surface meshes", loc="surf" ) pial = OutputMultiPath( - File(exists=True), desc="Gray matter/pia mater surface meshes", loc="surf" + File(exists=True), desc="Gray matter/pia matter surface meshes", loc="surf" ) area_pial = OutputMultiPath( File(exists=True), From abb0ecf95ea8f4b4bc5129479d4d568da909646f Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 9 Mar 2023 11:51:05 -0500 Subject: [PATCH 06/33] [DATALAD RUNCMD] rename strack var in doc to make codespell happier === Do not change lines below === { "chain": [], "cmd": "git-sedi strack streamtrack", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- nipype/interfaces/mrtrix/tracking.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/nipype/interfaces/mrtrix/tracking.py b/nipype/interfaces/mrtrix/tracking.py index 4619740fc2..4624d2c780 100644 --- a/nipype/interfaces/mrtrix/tracking.py +++ b/nipype/interfaces/mrtrix/tracking.py @@ -388,14 +388,14 @@ class StreamlineTrack(CommandLine): ------- >>> import nipype.interfaces.mrtrix as mrt - >>> strack = mrt.StreamlineTrack() - >>> strack.inputs.inputmodel = 'SD_PROB' - >>> strack.inputs.in_file = 'data.Bfloat' - >>> strack.inputs.seed_file = 'seed_mask.nii' - >>> strack.inputs.mask_file = 'mask.nii' - >>> strack.cmdline + >>> streamtrack = mrt.StreamlineTrack() + >>> streamtrack.inputs.inputmodel = 'SD_PROB' + >>> streamtrack.inputs.in_file = 'data.Bfloat' + >>> streamtrack.inputs.seed_file = 'seed_mask.nii' + >>> streamtrack.inputs.mask_file = 'mask.nii' + >>> streamtrack.cmdline 'streamtrack -mask mask.nii -seed seed_mask.nii SD_PROB data.Bfloat data_tracked.tck' - >>> strack.run() # doctest: +SKIP + >>> streamtrack.run() # doctest: +SKIP """ _cmd = "streamtrack" @@ -423,10 +423,10 @@ class DiffusionTensorStreamlineTrack(StreamlineTrack): ------- >>> import nipype.interfaces.mrtrix as mrt - >>> dtstrack = mrt.DiffusionTensorStreamlineTrack() - >>> dtstrack.inputs.in_file = 'data.Bfloat' - >>> dtstrack.inputs.seed_file = 'seed_mask.nii' - >>> dtstrack.run() # doctest: +SKIP + >>> dtstreamtrack = mrt.DiffusionTensorStreamlineTrack() + >>> dtstreamtrack.inputs.in_file = 'data.Bfloat' + >>> dtstreamtrack.inputs.seed_file = 'seed_mask.nii' + >>> dtstreamtrack.run() # doctest: +SKIP """ input_spec = DiffusionTensorStreamlineTrackInputSpec From 576bfc4e788894e83c2b1ab8a16e72b61cc7f284 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 9 Mar 2023 11:54:02 -0500 Subject: [PATCH 07/33] rename fo to f to please codespell for a file object --- nipype/interfaces/cmtk/nx.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nipype/interfaces/cmtk/nx.py b/nipype/interfaces/cmtk/nx.py index 991ca89dcf..15449515f4 100644 --- a/nipype/interfaces/cmtk/nx.py +++ b/nipype/interfaces/cmtk/nx.py @@ -542,8 +542,8 @@ def _run_interface(self, runtime): "Saving extra measure file to %s in Pickle format", op.abspath(out_pickled_extra_measures), ) - with open(out_pickled_extra_measures, "w") as fo: - pickle.dump(dict_measures, fo) + with open(out_pickled_extra_measures, "w") as f: + pickle.dump(dict_measures, f) iflogger.info("Saving MATLAB measures as %s", matlab) From 694b79ea82af146e95e7391f561d6cbd1cecc7ca Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 9 Mar 2023 12:02:42 -0500 Subject: [PATCH 08/33] Some ambigous typos fixes --- nipype/interfaces/ants/registration.py | 2 +- nipype/interfaces/freesurfer/longitudinal.py | 2 +- nipype/interfaces/fsl/model.py | 2 +- nipype/utils/profiler.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nipype/interfaces/ants/registration.py b/nipype/interfaces/ants/registration.py index cd2145b8d5..4b870b53ab 100644 --- a/nipype/interfaces/ants/registration.py +++ b/nipype/interfaces/ants/registration.py @@ -865,7 +865,7 @@ class Registration(ANTSCommand): --write-composite-transform 0' One can use multiple similarity metrics in a single registration stage.The Node below first - performs a linear registation using only the Mutual Information ('Mattes')-metric. + performs a linear registration using only the Mutual Information ('Mattes')-metric. In a second stage, it performs a non-linear registration ('Syn') using both a Mutual Information and a local cross-correlation ('CC')-metric. Both metrics are weighted equally ('metric_weight' is .5 for both). The Mutual Information- metric uses 32 bins. diff --git a/nipype/interfaces/freesurfer/longitudinal.py b/nipype/interfaces/freesurfer/longitudinal.py index 5c3f621e87..086d0a96c8 100644 --- a/nipype/interfaces/freesurfer/longitudinal.py +++ b/nipype/interfaces/freesurfer/longitudinal.py @@ -73,7 +73,7 @@ class RobustTemplateInputSpec(FSTraitedSpecOpenMP): ) initial_timepoint = traits.Int( argstr="--inittp %d", - desc="use TP# for spacial init (default random), 0: no init", + desc="use TP# for special init (default random), 0: no init", ) fixed_timepoint = traits.Bool( default_value=False, diff --git a/nipype/interfaces/fsl/model.py b/nipype/interfaces/fsl/model.py index 50485bac2e..b657ec2fb0 100644 --- a/nipype/interfaces/fsl/model.py +++ b/nipype/interfaces/fsl/model.py @@ -2026,7 +2026,7 @@ class ClusterInputSpec(FSLCommandInputSpec): argstr="--stdvol=%s", desc="filename for standard-space volume" ) num_maxima = traits.Int(argstr="--num=%d", desc="no of local maxima to report") - warpfield_file = File(argstr="--warpvol=%s", desc="file contining warpfield") + warpfield_file = File(argstr="--warpvol=%s", desc="file containing warpfield") class ClusterOutputSpec(TraitedSpec): diff --git a/nipype/utils/profiler.py b/nipype/utils/profiler.py index 2179b29db6..d83b745df5 100644 --- a/nipype/utils/profiler.py +++ b/nipype/utils/profiler.py @@ -44,7 +44,7 @@ def stop(self): class ResourceMonitor(threading.Thread): """ - A ``Thread`` to monitor a specific PID with a certain frequence + A ``Thread`` to monitor a specific PID with a certain frequency to a file """ From 48acdf82474888e6ed8bfd415979923d61f109c1 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 9 Mar 2023 12:12:36 -0500 Subject: [PATCH 09/33] ignores found in throughout review of diff --- .codespellrc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.codespellrc b/.codespellrc index 46ed8000f6..b1c1f65ac2 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,6 +1,11 @@ [codespell] skip = .git,*.pdf,*.svg,external -# nd - import module short +# nd,nam - import module short # fith - oddness coming from AFNI # whos - smth used in matlab things -ignore-words-list = te,inport,objekt,jist,nd,hel,inout,fith,whos,fot,ue,shs +# SMAL - Stanford CNI MRS Library +# Such - name +# noo,crasher - field/var name used +# Reson - short journal name +# ALS, FWE - neuroimaging specific abbrevs +ignore-words-list = te,inport,objekt,jist,nd,hel,inout,fith,whos,fot,ue,shs,smal,nam,filetest,such,noo,reson,als,fwe,crasher From 6e8285e9598cefb88e73ffe66b538057f5edbe6e Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 9 Mar 2023 12:13:48 -0500 Subject: [PATCH 10/33] [DATALAD RUNCMD] rename fastr var in doc to make codespell happier === Do not change lines below === { "chain": [], "cmd": "git-sedi fastr fast", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- nipype/interfaces/fsl/preprocess.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index 80ef25534a..f550fb1ef7 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -376,12 +376,12 @@ class FAST(FSLCommand): Examples -------- >>> from nipype.interfaces import fsl - >>> fastr = fsl.FAST() - >>> fastr.inputs.in_files = 'structural.nii' - >>> fastr.inputs.out_basename = 'fast_' - >>> fastr.cmdline + >>> fast = fsl.FAST() + >>> fast.inputs.in_files = 'structural.nii' + >>> fast.inputs.out_basename = 'fast_' + >>> fast.cmdline 'fast -o fast_ -S 1 structural.nii' - >>> out = fastr.run() # doctest: +SKIP + >>> out = fast.run() # doctest: +SKIP """ From 5b5d9cfd2184504f2bf3589d72700b3b722cc688 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 9 Mar 2023 12:15:06 -0500 Subject: [PATCH 11/33] ignores found in throughout review of diff --- .codespellrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.codespellrc b/.codespellrc index b1c1f65ac2..8b0990346b 100644 --- a/.codespellrc +++ b/.codespellrc @@ -4,8 +4,8 @@ skip = .git,*.pdf,*.svg,external # fith - oddness coming from AFNI # whos - smth used in matlab things # SMAL - Stanford CNI MRS Library -# Such - name +# Suh - name # noo,crasher - field/var name used # Reson - short journal name # ALS, FWE - neuroimaging specific abbrevs -ignore-words-list = te,inport,objekt,jist,nd,hel,inout,fith,whos,fot,ue,shs,smal,nam,filetest,such,noo,reson,als,fwe,crasher +ignore-words-list = te,inport,objekt,jist,nd,hel,inout,fith,whos,fot,ue,shs,smal,nam,filetest,suh,noo,reson,als,fwe,crasher From 536d4026cbf72893ee95f45fae07fbefcead5abd Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 9 Mar 2023 12:32:58 -0500 Subject: [PATCH 12/33] add ignore on Comision --- .codespellrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.codespellrc b/.codespellrc index 8b0990346b..fcf6e648ca 100644 --- a/.codespellrc +++ b/.codespellrc @@ -8,4 +8,5 @@ skip = .git,*.pdf,*.svg,external # noo,crasher - field/var name used # Reson - short journal name # ALS, FWE - neuroimaging specific abbrevs -ignore-words-list = te,inport,objekt,jist,nd,hel,inout,fith,whos,fot,ue,shs,smal,nam,filetest,suh,noo,reson,als,fwe,crasher +# Comision - foreign word used +ignore-words-list = te,inport,objekt,jist,nd,hel,inout,fith,whos,fot,ue,shs,smal,nam,filetest,suh,noo,reson,als,fwe,crasher,comision From d54532d38c97171c644b0daa0d1d0df1b9e7a9e6 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 9 Mar 2023 12:33:12 -0500 Subject: [PATCH 13/33] [DATALAD RUNCMD] Run codespell throughout === Do not change lines below === { "chain": [], "cmd": "codespell -w", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- doc/changelog/0.X.X-changelog.rst | 10 +++++----- doc/changelog/1.X.X-changelog.rst | 2 +- nipype/algorithms/icc.py | 4 ++-- nipype/interfaces/ants/segmentation.py | 6 +++--- nipype/interfaces/base/specs.py | 2 +- nipype/interfaces/spm/tests/test_utils.py | 8 ++++---- nipype/interfaces/tests/test_io.py | 6 +++--- tools/ex2rst | 2 +- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/doc/changelog/0.X.X-changelog.rst b/doc/changelog/0.X.X-changelog.rst index 8780afef84..8b779970d4 100644 --- a/doc/changelog/0.X.X-changelog.rst +++ b/doc/changelog/0.X.X-changelog.rst @@ -15,7 +15,7 @@ * ENH: Generate Dockerfiles with neurodocker (https://github.com/nipy/nipype/pull/2202) * ENH: FLAIR options for recon-all (https://github.com/nipy/nipype/pull/2279) * ENH: Config option for setting maxtasksperchild when multiprocessing (https://github.com/nipy/nipype/pull/2284) -* FIX: Testing maintainance and improvements (https://github.com/nipy/nipype/pull/2252) +* FIX: Testing maintenance and improvements (https://github.com/nipy/nipype/pull/2252) * ENH: Add elapsed_time and final metric_value to ants.Registration (https://github.com/nipy/nipype/pull/1985) * ENH: Improve terminal_output feature (https://github.com/nipy/nipype/pull/2209) * ENH: Simple interface to FSL std2imgcoords (https://github.com/nipy/nipype/pull/2209, prev #1398) @@ -39,7 +39,7 @@ * ENH: Add cosine-basis high-pass-filter to CompCor, allow skip of initial volumes (https://github.com/nipy/nipype/pull/2107, https://github.com/nipy/nipype/pull/#2122) * FIX: Catch more dcm2niix DTI conversions (https://github.com/nipy/nipype/pull/2110) * FIX: Retrieve aseg + wmparc stats properly (https://github.com/nipy/nipype/pull/2117) -* ENH: ANTs MeasureImageSimilarity Inteface (https://github.com/nipy/nipype/pull/2128) +* ENH: ANTs MeasureImageSimilarity Interface (https://github.com/nipy/nipype/pull/2128) * FIX: CompCor filter_basis of correct size, pre-filter column headers (https://github.com/nipy/nipype/pull/2136, https://github.com/nipy/nipype/pull/2138) * ENH: FreeSurfer lta_convert and mri_coreg interfaces (https://github.com/nipy/nipype/pull/2140, https://github.com/nipy/nipype/pull/2172) * ENH: Speed up S3DataGrabber (https://github.com/nipy/nipype/pull/2143) @@ -311,7 +311,7 @@ Release 0.11.0 (September 15, 2015) Release 0.10.0 (October 10, 2014) ================================= -* ENH: New miscelaneous interfaces: SplitROIs (mapper), MergeROIs (reducer) +* ENH: New miscellaneous interfaces: SplitROIs (mapper), MergeROIs (reducer) to enable parallel processing of very large images. * ENH: Updated FSL interfaces: BEDPOSTX and XFibres, former interfaces are still available with the version suffix: BEDPOSTX4 and XFibres4. Added gpu @@ -320,7 +320,7 @@ Release 0.10.0 (October 10, 2014) * ENH: New dipy interfaces: Denoise, Resample * ENH: New Freesurfer interfaces: Tkregister2 (for conversion of fsl style matrices to freesurfer format), MRIPretess * ENH: New FSL interfaces: WarpPoints, WarpPointsToStd, EpiReg, ProbTrackX2, WarpUtils, ConvertWarp -* ENH: New miscelaneous interfaces: AddCSVRow, NormalizeProbabilityMapSet, AddNoise +* ENH: New miscellaneous interfaces: AddCSVRow, NormalizeProbabilityMapSet, AddNoise * ENH: New AFNI interfaces: Eval, Means, SVMTest, SVMTrain * ENH: FUGUE interface has been refactored to use the name_template system, 3 examples added to doctests, some bugs solved. @@ -510,7 +510,7 @@ Release 0.5 (Mar 10, 2012) * API: By default inputs are removed from Node working directory * API: InterfaceResult class is now versioned and stores class type not instance * API: Added FIRST interface -* API: Added max_jobs paramter to plugin_args. limits the number of jobs +* API: Added max_jobs parameter to plugin_args. limits the number of jobs executing at any given point in time * API: crashdump_dir is now a config execution option * API: new config execution options for controlling hash checking, execution and diff --git a/doc/changelog/1.X.X-changelog.rst b/doc/changelog/1.X.X-changelog.rst index f6a9233f5e..6b3647a86d 100644 --- a/doc/changelog/1.X.X-changelog.rst +++ b/doc/changelog/1.X.X-changelog.rst @@ -426,7 +426,7 @@ Python 1.2.3 will be the last version to support Python 3.4. * FIX: ANTS LaplacianThickness cmdline opts fixed up (https://github.com/nipy/nipype/pull/2846) * FIX: Resolve LinAlgError during SVD (https://github.com/nipy/nipype/pull/2838) - * ENH: Add interfaces wrapping DIPY worflows (https://github.com/nipy/nipype/pull/2830) + * ENH: Add interfaces wrapping DIPY workflows (https://github.com/nipy/nipype/pull/2830) * ENH: Update BIDSDataGrabber for pybids 0.7 (https://github.com/nipy/nipype/pull/2737) * ENH: Add FSL `eddy_quad` interface (https://github.com/nipy/nipype/pull/2825) * ENH: Support tckgen -select in MRtrix3 v3+ (https://github.com/nipy/nipype/pull/2823) diff --git a/nipype/algorithms/icc.py b/nipype/algorithms/icc.py index 38f56d6541..8e5c6b150c 100644 --- a/nipype/algorithms/icc.py +++ b/nipype/algorithms/icc.py @@ -150,8 +150,8 @@ def ICC_rep_anova(Y, projection_matrix=None): SSR = SST - SSC - SSE MSR = SSR / dfr - # ICC(3,1) = (mean square subjeT - mean square error) / - # (mean square subjeT + (k-1)*-mean square error) + # ICC(3,1) = (mean square subject - mean square error) / + # (mean square subject + (k-1)*-mean square error) ICC = (MSR - MSE) / (MSR + dfc * MSE) e_var = MSE # variance of error diff --git a/nipype/interfaces/ants/segmentation.py b/nipype/interfaces/ants/segmentation.py index 9467c4086f..8af76d95b9 100644 --- a/nipype/interfaces/ants/segmentation.py +++ b/nipype/interfaces/ants/segmentation.py @@ -1009,10 +1009,10 @@ def _run_interface(self, runtime, correct_return_codes=(0,)): runtime = super(BrainExtraction, self)._run_interface(runtime) # Still, double-check if it didn't found N4 - if "we cant find" in runtime.stdout: + if "we can't find" in runtime.stdout: for line in runtime.stdout.split("\n"): - if line.strip().startswith("we cant find"): - tool = line.strip().replace("we cant find the", "").split(" ")[0] + if line.strip().startswith("we can't find"): + tool = line.strip().replace("we can't find the", "").split(" ")[0] break errmsg = ( diff --git a/nipype/interfaces/base/specs.py b/nipype/interfaces/base/specs.py index 5c92c7ec69..01ef126abb 100644 --- a/nipype/interfaces/base/specs.py +++ b/nipype/interfaces/base/specs.py @@ -177,7 +177,7 @@ def get_traitsfree(self, **kwargs): return out def _clean_container(self, objekt, undefinedval=None, skipundefined=False): - """Convert a traited obejct into a pure python representation.""" + """Convert a traited object into a pure python representation.""" if isinstance(objekt, TraitDictObject) or isinstance(objekt, dict): out = {} for key, val in list(objekt.items()): diff --git a/nipype/interfaces/spm/tests/test_utils.py b/nipype/interfaces/spm/tests/test_utils.py index 1afc887b06..c41a0da966 100644 --- a/nipype/interfaces/spm/tests/test_utils.py +++ b/nipype/interfaces/spm/tests/test_utils.py @@ -23,7 +23,7 @@ def test_coreg(): _, tgt, _ = split_filename(target) mat = os.path.join(pth, "%s_to_%s.mat" % (mov, tgt)) invmat = fname_presuffix(mat, prefix="inverse_") - scrpt = coreg._make_matlab_command(None) + script = coreg._make_matlab_command(None) assert coreg.inputs.mat == mat assert coreg.inputs.invmat == invmat @@ -35,11 +35,11 @@ def test_apply_transform(): assert applymat.inputs.matlab_cmd == "mymatlab" applymat.inputs.in_file = moving applymat.inputs.mat = mat - scrpt = applymat._make_matlab_command(None) + script = applymat._make_matlab_command(None) expected = "[p n e v] = spm_fileparts(V.fname);" - assert expected in scrpt + assert expected in script expected = "V.mat = transform.M * V.mat;" - assert expected in scrpt + assert expected in script def test_reslice(): diff --git a/nipype/interfaces/tests/test_io.py b/nipype/interfaces/tests/test_io.py index 45bd53e32c..400ee7cabc 100644 --- a/nipype/interfaces/tests/test_io.py +++ b/nipype/interfaces/tests/test_io.py @@ -708,10 +708,10 @@ def _mock_get_ssh_client(self): def test_ExportFile(tmp_path): - testin = tmp_path / "in.txt" - testin.write_text("test string", encoding='utf-8') + testing = tmp_path / "in.txt" + testing.write_text("test string", encoding='utf-8') i = nio.ExportFile() - i.inputs.in_file = str(testin) + i.inputs.in_file = str(testing) i.inputs.out_file = str(tmp_path / "out.tsv") i.inputs.check_extension = True with pytest.raises(RuntimeError): diff --git a/tools/ex2rst b/tools/ex2rst index 82653f80e5..1b19ce8726 100755 --- a/tools/ex2rst +++ b/tools/ex2rst @@ -98,7 +98,7 @@ def exfile2rst(filename): proc_line = None # handle doc start if not indocs: - # guarenteed to start with """ + # guaranteed to start with """ if len(cleanline) > 3 \ and (cleanline.endswith('"""') \ or cleanline.endswith("'''")): From 06224fbadcbec5b441fcce2c28909b1c8f3d6059 Mon Sep 17 00:00:00 2001 From: mauriliogenovese Date: Fri, 31 Mar 2023 14:59:35 +0200 Subject: [PATCH 14/33] input types fix --- nipype/interfaces/fsl/dti.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nipype/interfaces/fsl/dti.py b/nipype/interfaces/fsl/dti.py index a49c508c64..a2f94229cd 100644 --- a/nipype/interfaces/fsl/dti.py +++ b/nipype/interfaces/fsl/dti.py @@ -674,8 +674,8 @@ class ProbTrackXBaseInputSpec(FSLCommandInputSpec): c_thresh = traits.Float( argstr="--cthr=%.3f", desc="curvature threshold - default=0.2" ) - sample_random_points = traits.Bool( - argstr="--sampvox", desc=("sample random points within " "seed voxels") + sample_random_points = traits.Float( + argstr="--sampvox=%.3f", desc=("sample random points within " "seed voxels") ) step_length = traits.Float( argstr="--steplength=%.3f", desc="step_length in mm - default=0.5" @@ -714,7 +714,7 @@ class ProbTrackXBaseInputSpec(FSLCommandInputSpec): ), ) mod_euler = traits.Bool(argstr="--modeuler", desc="use modified euler streamlining") - random_seed = traits.Bool(argstr="--rseed", desc="random seed") + random_seed = traits.Int(argstr="--rseed=%d", desc="random seed") s2tastext = traits.Bool( argstr="--s2tastext", desc=( From 73d608452b780cfab54229a2ce5e1dbad682129d Mon Sep 17 00:00:00 2001 From: Michael Bannert Date: Mon, 3 Apr 2023 16:42:56 +0000 Subject: [PATCH 15/33] added voxel-based FDR thresholding in SPM --- .pre-commit-config.yaml | 4 ++-- .zenodo.json | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d5c5a4a51a..1336a23a2d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,13 +2,13 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.4.0 + rev: v4.4.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml - id: check-added-large-files - repo: https://github.com/psf/black - rev: 20.8b1 + rev: 23.3.0 hooks: - id: black diff --git a/.zenodo.json b/.zenodo.json index fd9e5e9658..d03912c7a8 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -890,6 +890,11 @@ "affiliation": "MIT, HMS", "name": "Ghosh, Satrajit", "orcid": "0000-0002-5312-6729" + }, + { + "affiliation": "University of Tübingen and MPI for Biological Cybernertics", + "name": "Bannert, Michael M.", + "orcid": "0000-0003-1010-7517" } ], "keywords": [ From 27fc8284993501e707ed873f7b03c99c032761a1 Mon Sep 17 00:00:00 2001 From: Michael Bannert Date: Mon, 3 Apr 2023 16:43:49 +0000 Subject: [PATCH 16/33] added voxel-based FDR thresholding in SPM --- nipype/interfaces/spm/model.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/nipype/interfaces/spm/model.py b/nipype/interfaces/spm/model.py index 0c2eece0d5..68a2484c86 100644 --- a/nipype/interfaces/spm/model.py +++ b/nipype/interfaces/spm/model.py @@ -586,6 +586,16 @@ class ThresholdInputSpec(SPMCommandInputSpec): "set to p-value)" ), ) + use_vox_fdr_correction = traits.Bool( + False, + usedefault=True, + desc=( + "whether to use voxel-based FDR " + "correction for initial threshold " + "(height_threshold_type has to be " + "set to q-value)" + ), + ) use_topo_fdr = traits.Bool( True, usedefault=True, @@ -661,8 +671,16 @@ def _gen_pre_topo_map_filename(self): def _make_matlab_command(self, _): script = "con_index = %d;\n" % self.inputs.contrast_index script += "cluster_forming_thr = %f;\n" % self.inputs.height_threshold - if self.inputs.use_fwe_correction: + + if self.inputs.use_fwe_correction and self.inputs.use_vox_fdr_correction: + raise ValueError( + "'use_fwe_correction' and 'use_vox_fdr_correction' can't both be True" + ) + + if self.inputs.use_fwe_correction and not self.inputs.use_vox_fdr_correction: script += "thresDesc = 'FWE';\n" + elif self.inputs.use_vox_fdr_correction and not self.inputs.use_fwe_correction: + script += "thresDesc = 'FDR';\n" else: script += "thresDesc = 'none';\n" @@ -687,6 +705,8 @@ def _make_matlab_command(self, _): FWHM = SPM.xVol.FWHM; df = [SPM.xCon(con_index).eidf SPM.xX.erdf]; STAT = SPM.xCon(con_index).STAT; +VspmSv = cat(1,SPM.xCon(con_index).Vspm); + R = SPM.xVol.R; S = SPM.xVol.S; n = 1; @@ -695,6 +715,9 @@ def _make_matlab_command(self, _): case 'FWE' cluster_forming_thr = spm_uc(cluster_forming_thr,df,STAT,R,n,S); + case 'FDR' + cluster_forming_thr = spm_uc_FDR(cluster_forming_thr,df,STAT,n,VspmSv,0); + case 'none' if strcmp(height_threshold_type, 'p-value') cluster_forming_thr = spm_u(cluster_forming_thr^(1/n),df,STAT); From d0830fa7f25b7f16c0a0c1c23b3dec80f7db96bb Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Wed, 5 Apr 2023 13:32:48 -0400 Subject: [PATCH 17/33] FIX: Declare no have_nipy if import fails for any reason --- nipype/interfaces/nipy/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nipype/interfaces/nipy/base.py b/nipype/interfaces/nipy/base.py index 0991730e81..2d742d3e90 100644 --- a/nipype/interfaces/nipy/base.py +++ b/nipype/interfaces/nipy/base.py @@ -12,7 +12,7 @@ have_nipy = True try: package_check("nipy") -except ImportError: +except: have_nipy = False From bfa37d7b1a7dfe94bc969f33156f91c18c494c64 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Wed, 5 Apr 2023 13:53:13 -0400 Subject: [PATCH 18/33] CI: Drop nipy tests until a fixed nipy is released --- .github/workflows/tests.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d5a94ab940..fee8740987 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -105,13 +105,13 @@ jobs: depends: REQUIREMENTS deb-depends: true nipype-extras: doc,tests,profiler,duecredit,ssh - - os: ubuntu-20.04 - python-version: 3.8 - check: test - pip-flags: '' - depends: NUMPY123 - deb-depends: true - nipype-extras: doc,tests,nipy,profiler,duecredit,ssh + # - os: ubuntu-20.04 + # python-version: 3.8 + # check: test + # pip-flags: '' + # depends: NUMPY123 + # deb-depends: true + # nipype-extras: doc,tests,nipy,profiler,duecredit,ssh env: DEPENDS: ${{ matrix.depends }} CHECK_TYPE: ${{ matrix.check }} From a9ce9b78a402ebacf7726ad6454bb75b1447f52f Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Wed, 5 Apr 2023 14:01:05 -0400 Subject: [PATCH 19/33] STY: black [ignore-rev] --- nipype/algorithms/misc.py | 1 - nipype/algorithms/tests/test_ErrorMap.py | 1 - nipype/algorithms/tests/test_misc.py | 2 -- .../algorithms/tests/test_normalize_tpms.py | 1 - nipype/conftest.py | 1 - nipype/external/cloghandler.py | 4 +++- nipype/interfaces/afni/preprocess.py | 2 -- nipype/interfaces/afni/utils.py | 2 -- nipype/interfaces/base/core.py | 1 - nipype/interfaces/base/traits_extension.py | 1 - nipype/interfaces/brainsuite/brainsuite.py | 1 - nipype/interfaces/cat12/preprocess.py | 3 --- nipype/interfaces/cmtk/cmtk.py | 1 - nipype/interfaces/dcm2nii.py | 3 ++- nipype/interfaces/freesurfer/model.py | 1 - nipype/interfaces/freesurfer/petsurfer.py | 3 --- nipype/interfaces/freesurfer/preprocess.py | 8 ------- .../freesurfer/tests/test_FSSurfaceCommand.py | 1 - .../interfaces/freesurfer/tests/test_utils.py | 4 ---- nipype/interfaces/freesurfer/utils.py | 13 ----------- nipype/interfaces/fsl/dti.py | 5 ---- nipype/interfaces/fsl/fix.py | 1 - nipype/interfaces/fsl/maths.py | 23 ------------------- nipype/interfaces/fsl/tests/test_dti.py | 2 -- .../interfaces/fsl/tests/test_preprocess.py | 3 +-- nipype/interfaces/fsl/utils.py | 8 ------- nipype/interfaces/io.py | 14 ----------- nipype/interfaces/minc/base.py | 2 +- nipype/interfaces/minc/minc.py | 1 - .../niftyseg/tests/test_em_interfaces.py | 1 - .../niftyseg/tests/test_extra_PatchMatch.py | 1 - .../interfaces/niftyseg/tests/test_lesions.py | 1 - .../interfaces/niftyseg/tests/test_maths.py | 5 ---- nipype/interfaces/nitime/analysis.py | 1 - nipype/interfaces/spm/base.py | 1 - nipype/interfaces/spm/preprocess.py | 7 ------ nipype/interfaces/spm/utils.py | 1 - nipype/interfaces/tests/test_io.py | 1 - nipype/interfaces/tests/test_nilearn.py | 1 - nipype/pipeline/engine/tests/test_engine.py | 1 - .../pipeline/engine/tests/test_workflows.py | 1 - nipype/pipeline/plugins/slurm.py | 1 - .../tests/test_legacymultiproc_nondaemon.py | 3 --- nipype/tests/test_nipype.py | 2 -- nipype/utils/nipype_cmd.py | 1 - nipype/utils/tests/test_filemanip.py | 1 - 46 files changed, 7 insertions(+), 136 deletions(-) diff --git a/nipype/algorithms/misc.py b/nipype/algorithms/misc.py index 23006aad8b..839696144e 100644 --- a/nipype/algorithms/misc.py +++ b/nipype/algorithms/misc.py @@ -968,7 +968,6 @@ class CalculateNormalizedMoments(BaseInterface): output_spec = CalculateNormalizedMomentsOutputSpec def _run_interface(self, runtime): - self._moments = calc_moments(self.inputs.timeseries_file, self.inputs.moment) return runtime diff --git a/nipype/algorithms/tests/test_ErrorMap.py b/nipype/algorithms/tests/test_ErrorMap.py index adac507bad..faae860a5a 100644 --- a/nipype/algorithms/tests/test_ErrorMap.py +++ b/nipype/algorithms/tests/test_ErrorMap.py @@ -10,7 +10,6 @@ def test_errormap(tmpdir): - # Single-Spectual # Make two fake 2*2*2 voxel volumes # John von Neumann's birthday diff --git a/nipype/algorithms/tests/test_misc.py b/nipype/algorithms/tests/test_misc.py index 755527da49..3303344ef6 100644 --- a/nipype/algorithms/tests/test_misc.py +++ b/nipype/algorithms/tests/test_misc.py @@ -13,7 +13,6 @@ def test_CreateNifti(create_analyze_pair_file_in_directory): - filelist, outdir = create_analyze_pair_file_in_directory create_nifti = misc.CreateNifti() @@ -35,7 +34,6 @@ def test_CreateNifti(create_analyze_pair_file_in_directory): def test_CalculateMedian(create_analyze_pair_file_in_directory): - mean = misc.CalculateMedian() with pytest.raises(TypeError): diff --git a/nipype/algorithms/tests/test_normalize_tpms.py b/nipype/algorithms/tests/test_normalize_tpms.py index 9541d5d882..99aa5950ae 100644 --- a/nipype/algorithms/tests/test_normalize_tpms.py +++ b/nipype/algorithms/tests/test_normalize_tpms.py @@ -16,7 +16,6 @@ def test_normalize_tpms(tmpdir): - in_mask = example_data("tpms_msk.nii.gz") mskdata = np.asanyarray(nb.load(in_mask).dataobj) mskdata[mskdata > 0.0] = 1.0 diff --git a/nipype/conftest.py b/nipype/conftest.py index 7323e72846..18b8a1ca6d 100644 --- a/nipype/conftest.py +++ b/nipype/conftest.py @@ -27,7 +27,6 @@ def _docdir(request): # Trigger ONLY for the doctests. doctest_plugin = request.config.pluginmanager.getplugin("doctest") if isinstance(request.node, doctest_plugin.DoctestItem): - # Get the fixture dynamically by its name. tmpdir = pp.local(data_dir) diff --git a/nipype/external/cloghandler.py b/nipype/external/cloghandler.py index 08db7a3a0a..c861654990 100644 --- a/nipype/external/cloghandler.py +++ b/nipype/external/cloghandler.py @@ -151,7 +151,9 @@ def __init__( ) try: BaseRotatingHandler.__init__(self, filename, mode, encoding) - except TypeError: # Due to a different logging release without encoding support (Python 2.4.1 and earlier?) + except ( + TypeError + ): # Due to a different logging release without encoding support (Python 2.4.1 and earlier?) BaseRotatingHandler.__init__(self, filename, mode) self.encoding = encoding diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index 4fdb006554..0eec60cd62 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -1133,7 +1133,6 @@ class ClipLevel(AFNICommandBase): output_spec = ClipLevelOutputSpec def aggregate_outputs(self, runtime=None, needed_outputs=None): - outputs = self._outputs() outfile = os.path.join(os.getcwd(), "stat_result.json") @@ -2295,7 +2294,6 @@ class Seg(AFNICommandBase): output_spec = AFNICommandOutputSpec def aggregate_outputs(self, runtime=None, needed_outputs=None): - import glob outputs = self._outputs() diff --git a/nipype/interfaces/afni/utils.py b/nipype/interfaces/afni/utils.py index ef27d86b13..3075cffce3 100644 --- a/nipype/interfaces/afni/utils.py +++ b/nipype/interfaces/afni/utils.py @@ -302,7 +302,6 @@ class BrickStat(AFNICommandBase): output_spec = BrickStatOutputSpec def aggregate_outputs(self, runtime=None, needed_outputs=None): - outputs = self._outputs() outfile = os.path.join(os.getcwd(), "stat_result.json") @@ -2595,7 +2594,6 @@ def _format_arg(self, name, spec, value): class ResampleInputSpec(AFNICommandInputSpec): - in_file = File( desc="input file to 3dresample", argstr="-inset %s", diff --git a/nipype/interfaces/base/core.py b/nipype/interfaces/base/core.py index 8a20da3fb1..81da68be00 100644 --- a/nipype/interfaces/base/core.py +++ b/nipype/interfaces/base/core.py @@ -389,7 +389,6 @@ def run(self, cwd=None, ignore_exception=None, **inputs): self._check_version_requirements(self.inputs) with rtc(self, cwd=cwd, redirect_x=self._redirect_x) as runtime: - # Grab inputs now, as they should not change during execution inputs = self.inputs.get_traitsfree() outputs = None diff --git a/nipype/interfaces/base/traits_extension.py b/nipype/interfaces/base/traits_extension.py index 9ac4aa1839..cadce596fb 100644 --- a/nipype/interfaces/base/traits_extension.py +++ b/nipype/interfaces/base/traits_extension.py @@ -405,7 +405,6 @@ class MultiObject(traits.List): """Abstract class - shared functionality of input and output MultiObject""" def validate(self, objekt, name, value): - # want to treat range and other sequences (except str) as list if not isinstance(value, (str, bytes)) and isinstance(value, Sequence): value = list(value) diff --git a/nipype/interfaces/brainsuite/brainsuite.py b/nipype/interfaces/brainsuite/brainsuite.py index f353017e58..91f762f47d 100644 --- a/nipype/interfaces/brainsuite/brainsuite.py +++ b/nipype/interfaces/brainsuite/brainsuite.py @@ -19,7 +19,6 @@ class BseInputSpec(CommandLineInputSpec): - inputMRIFile = File(mandatory=True, argstr="-i %s", desc="input MRI volume") outputMRIVolume = File( desc="output brain-masked MRI volume. If unspecified, output file name will be auto generated.", diff --git a/nipype/interfaces/cat12/preprocess.py b/nipype/interfaces/cat12/preprocess.py index eec0ea936d..1d962bc08b 100644 --- a/nipype/interfaces/cat12/preprocess.py +++ b/nipype/interfaces/cat12/preprocess.py @@ -537,7 +537,6 @@ def _list_outputs(self): ] for tidx, tissue in enumerate(["gm", "wm", "csf"]): - for image, prefix in [("modulated", "mw"), ("dartel", "r"), ("native", "")]: outtype = f"{tissue}_output_{image}" if isdefined(getattr(self.inputs, outtype)) and getattr( @@ -594,7 +593,6 @@ def _list_outputs(self): class CAT12SANLMDenoisingInputSpec(SPMCommandInputSpec): - in_files = InputMultiPath( ImageFileSPM(exists=True), field="data", @@ -679,7 +677,6 @@ class CAT12SANLMDenoisingInputSpec(SPMCommandInputSpec): class CAT12SANLMDenoisingOutputSpec(TraitedSpec): - out_file = File(desc="out file") diff --git a/nipype/interfaces/cmtk/cmtk.py b/nipype/interfaces/cmtk/cmtk.py index 00c134fc37..bc5f2de2a5 100644 --- a/nipype/interfaces/cmtk/cmtk.py +++ b/nipype/interfaces/cmtk/cmtk.py @@ -272,7 +272,6 @@ def cmat( dis = 0 for i in range(endpoints.shape[0]): - # ROI start => ROI end try: startROI = int( diff --git a/nipype/interfaces/dcm2nii.py b/nipype/interfaces/dcm2nii.py index 1ba6f24eb9..4732e50e4e 100644 --- a/nipype/interfaces/dcm2nii.py +++ b/nipype/interfaces/dcm2nii.py @@ -119,7 +119,8 @@ class Dcm2nii(CommandLine): >>> converter.inputs.gzip_output = True >>> converter.inputs.output_dir = '.' >>> converter.cmdline # doctest: +ELLIPSIS - 'dcm2nii -a y -c y -b config.ini -v y -d y -e y -g y -i n -n y -o . -p y -x n -f n functional_1.dcm'""" + 'dcm2nii -a y -c y -b config.ini -v y -d y -e y -g y -i n -n y -o . -p y -x n -f n functional_1.dcm' + """ input_spec = Dcm2niiInputSpec output_spec = Dcm2niiOutputSpec diff --git a/nipype/interfaces/freesurfer/model.py b/nipype/interfaces/freesurfer/model.py index f1b7fafe53..5c06a09238 100644 --- a/nipype/interfaces/freesurfer/model.py +++ b/nipype/interfaces/freesurfer/model.py @@ -449,7 +449,6 @@ class GLMFitInputSpec(FSTraitedSpec): class GLMFitOutputSpec(TraitedSpec): - glm_dir = Directory(exists=True, desc="output directory") beta_file = File(exists=True, desc="map of regression coefficients") error_file = File(desc="map of residual error") diff --git a/nipype/interfaces/freesurfer/petsurfer.py b/nipype/interfaces/freesurfer/petsurfer.py index d04409ad20..33602d2711 100644 --- a/nipype/interfaces/freesurfer/petsurfer.py +++ b/nipype/interfaces/freesurfer/petsurfer.py @@ -24,7 +24,6 @@ class GTMSegInputSpec(FSTraitedSpec): - subject_id = traits.String(argstr="--s %s", desc="subject id", mandatory=True) xcerseg = traits.Bool( @@ -136,7 +135,6 @@ def _list_outputs(self): class GTMPVCInputSpec(FSTraitedSpec): - in_file = File( exists=True, argstr="--i %s", @@ -422,7 +420,6 @@ class GTMPVCInputSpec(FSTraitedSpec): class GTMPVCOutputSpec(TraitedSpec): - pvc_dir = Directory(desc="output directory") ref_file = File(desc="Reference TAC in .dat") hb_nifti = File(desc="High-binding TAC in nifti") diff --git a/nipype/interfaces/freesurfer/preprocess.py b/nipype/interfaces/freesurfer/preprocess.py index 4c9009cd10..ccf783a1e3 100644 --- a/nipype/interfaces/freesurfer/preprocess.py +++ b/nipype/interfaces/freesurfer/preprocess.py @@ -1833,7 +1833,6 @@ class BBRegister(FSCommand): output_spec = BBRegisterOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() _in = self.inputs @@ -1893,7 +1892,6 @@ def _format_arg(self, name, spec, value): return super(BBRegister, self)._format_arg(name, spec, value) def _gen_filename(self, name): - if name == "out_reg_file": return self._list_outputs()[name] return None @@ -2180,7 +2178,6 @@ def _gen_filename(self, name): class RobustRegisterInputSpec(FSTraitedSpec): - source_file = File( exists=True, mandatory=True, argstr="--mov %s", desc="volume to be registered" ) @@ -2302,7 +2299,6 @@ class RobustRegisterInputSpec(FSTraitedSpec): class RobustRegisterOutputSpec(TraitedSpec): - out_reg_file = File(exists=True, desc="output registration file") registered_file = File(exists=True, desc="output image with registration applied") weights_file = File(exists=True, desc="image of weights used") @@ -2388,7 +2384,6 @@ def _list_outputs(self): class FitMSParamsInputSpec(FSTraitedSpec): - in_files = traits.List( File(exists=True), argstr="%s", @@ -2408,7 +2403,6 @@ class FitMSParamsInputSpec(FSTraitedSpec): class FitMSParamsOutputSpec(TraitedSpec): - t1_image = File(exists=True, desc="image of estimated T1 relaxation values") pd_image = File(exists=True, desc="image of estimated proton density values") t2star_image = File(exists=True, desc="image of estimated T2* values") @@ -2466,7 +2460,6 @@ def _gen_filename(self, name): class SynthesizeFLASHInputSpec(FSTraitedSpec): - fixed_weighting = traits.Bool( position=1, argstr="-w", @@ -2495,7 +2488,6 @@ class SynthesizeFLASHInputSpec(FSTraitedSpec): class SynthesizeFLASHOutputSpec(TraitedSpec): - out_file = File(exists=True, desc="synthesized FLASH acquisition") diff --git a/nipype/interfaces/freesurfer/tests/test_FSSurfaceCommand.py b/nipype/interfaces/freesurfer/tests/test_FSSurfaceCommand.py index 6c377c9579..cdc2cc3131 100644 --- a/nipype/interfaces/freesurfer/tests/test_FSSurfaceCommand.py +++ b/nipype/interfaces/freesurfer/tests/test_FSSurfaceCommand.py @@ -35,7 +35,6 @@ def test_associated_file(tmpdir): ("./lh.white", "./lh.pial"), (fsavginfo["white"], fsavginfo["pial"]), ]: - # Unspecified paths, possibly with missing hemisphere information, # are equivalent to using the same directory and hemisphere for name in ("pial", "lh.pial", pial): diff --git a/nipype/interfaces/freesurfer/tests/test_utils.py b/nipype/interfaces/freesurfer/tests/test_utils.py index 0ee9dd3751..09584a404e 100644 --- a/nipype/interfaces/freesurfer/tests/test_utils.py +++ b/nipype/interfaces/freesurfer/tests/test_utils.py @@ -17,7 +17,6 @@ @pytest.mark.skipif(fs.no_freesurfer(), reason="freesurfer is not installed") def test_sample2surf(create_files_in_directory_plus_dummy_file): - s2s = fs.SampleToSurface() # Test underlying command assert s2s.cmd == "mri_vol2surf" @@ -65,7 +64,6 @@ def set_illegal_range(): @pytest.mark.skipif(fs.no_freesurfer(), reason="freesurfer is not installed") def test_surfsmooth(create_surf_file_in_directory): - smooth = fs.SurfaceSmooth() # Test underlying command @@ -104,7 +102,6 @@ def test_surfsmooth(create_surf_file_in_directory): @pytest.mark.skipif(fs.no_freesurfer(), reason="freesurfer is not installed") def test_surfxfm(create_surf_file_in_directory): - xfm = fs.SurfaceTransform() # Test underlying command @@ -141,7 +138,6 @@ def test_surfxfm(create_surf_file_in_directory): @pytest.mark.skipif(fs.no_freesurfer(), reason="freesurfer is not installed") def test_surfshots(create_files_in_directory_plus_dummy_file): - fotos = fs.SurfaceSnapshots() # Test underlying command diff --git a/nipype/interfaces/freesurfer/utils.py b/nipype/interfaces/freesurfer/utils.py index 9ee65366d2..921bb7488f 100644 --- a/nipype/interfaces/freesurfer/utils.py +++ b/nipype/interfaces/freesurfer/utils.py @@ -116,7 +116,6 @@ def createoutputdirs(outputs): class SampleToSurfaceInputSpec(FSTraitedSpec): - source_file = File( exists=True, mandatory=True, @@ -289,7 +288,6 @@ class SampleToSurfaceInputSpec(FSTraitedSpec): class SampleToSurfaceOutputSpec(TraitedSpec): - out_file = File(exists=True, desc="surface file") hits_file = File(exists=True, desc="image with number of hits at each voxel") vox_file = File( @@ -426,7 +424,6 @@ def _gen_filename(self, name): class SurfaceSmoothInputSpec(FSTraitedSpec): - in_file = File(mandatory=True, argstr="--sval %s", desc="source surface file") subject_id = traits.String( mandatory=True, argstr="--s %s", desc="subject id of surface file" @@ -455,7 +452,6 @@ class SurfaceSmoothInputSpec(FSTraitedSpec): class SurfaceSmoothOutputSpec(TraitedSpec): - out_file = File(exists=True, desc="smoothed surface file") @@ -753,7 +749,6 @@ class Surface2VolTransform(FSCommand): class ApplyMaskInputSpec(FSTraitedSpec): - in_file = File( exists=True, mandatory=True, @@ -803,7 +798,6 @@ class ApplyMaskInputSpec(FSTraitedSpec): class ApplyMaskOutputSpec(TraitedSpec): - out_file = File(exists=True, desc="masked image") @@ -822,7 +816,6 @@ class ApplyMask(FSCommand): class SurfaceSnapshotsInputSpec(FSTraitedSpec): - subject_id = traits.String( position=1, argstr="%s", mandatory=True, desc="subject to visualize" ) @@ -956,7 +949,6 @@ class SurfaceSnapshotsInputSpec(FSTraitedSpec): class SurfaceSnapshotsOutputSpec(TraitedSpec): - snapshots = OutputMultiPath( File(exists=True), desc="tiff images of the surface from different perspectives" ) @@ -1118,12 +1110,10 @@ def _gen_filename(self, name): class ImageInfoInputSpec(FSTraitedSpec): - in_file = File(exists=True, position=1, argstr="%s", desc="image to query") class ImageInfoOutputSpec(TraitedSpec): - info = traits.Any(desc="output of mri_info") out_file = File(exists=True, desc="text file with image information") data_type = traits.String(desc="image data type") @@ -1138,7 +1128,6 @@ class ImageInfoOutputSpec(TraitedSpec): class ImageInfo(FSCommand): - _cmd = "mri_info" input_spec = ImageInfoInputSpec output_spec = ImageInfoOutputSpec @@ -2015,7 +2004,6 @@ def _gen_outfilename(self): class AddXFormToHeaderInputSpec(FSTraitedSpec): - # required in_file = File( exists=True, mandatory=True, position=-2, argstr="%s", desc="input volume" @@ -2035,7 +2023,6 @@ class AddXFormToHeaderInputSpec(FSTraitedSpec): class AddXFormToHeaderOutputSpec(TraitedSpec): - out_file = File(exists=True, desc="output volume") diff --git a/nipype/interfaces/fsl/dti.py b/nipype/interfaces/fsl/dti.py index a49c508c64..60f0d8128d 100644 --- a/nipype/interfaces/fsl/dti.py +++ b/nipype/interfaces/fsl/dti.py @@ -462,7 +462,6 @@ def _cuda_update(self): self._cmd = self._default_cmd def _run_interface(self, runtime): - subjectdir = os.path.abspath(self.inputs.out_dir) if not os.path.exists(subjectdir): os.makedirs(subjectdir) @@ -1347,7 +1346,6 @@ def _gen_filename(self, name): class TractSkeletonInputSpec(FSLCommandInputSpec): - in_file = File( exists=True, mandatory=True, @@ -1385,7 +1383,6 @@ class TractSkeletonInputSpec(FSLCommandInputSpec): class TractSkeletonOutputSpec(TraitedSpec): - projected_data = File(desc="input data projected onto skeleton") skeleton_file = File(desc="tract skeleton image") @@ -1468,7 +1465,6 @@ def _list_outputs(self): class DistanceMapInputSpec(FSLCommandInputSpec): - in_file = File( exists=True, mandatory=True, @@ -1492,7 +1488,6 @@ class DistanceMapInputSpec(FSLCommandInputSpec): class DistanceMapOutputSpec(TraitedSpec): - distance_map = File(exists=True, desc="value is distance to nearest nonzero voxels") local_max_file = File(desc="image of local maxima") diff --git a/nipype/interfaces/fsl/fix.py b/nipype/interfaces/fsl/fix.py index 5c978f0a97..1b6d62a5bc 100644 --- a/nipype/interfaces/fsl/fix.py +++ b/nipype/interfaces/fsl/fix.py @@ -302,7 +302,6 @@ class Classifier(CommandLine): cmd = "fix -c" def _gen_artifacts_list_file(self, mel_ica, thresh): - _, trained_wts_file = os.path.split(self.inputs.trained_wts_file) trained_wts_filestem = trained_wts_file.split(".")[0] filestem = "fix4melview_" + trained_wts_filestem + "_thr" diff --git a/nipype/interfaces/fsl/maths.py b/nipype/interfaces/fsl/maths.py index 6e7baf74ce..d8669c4422 100644 --- a/nipype/interfaces/fsl/maths.py +++ b/nipype/interfaces/fsl/maths.py @@ -13,7 +13,6 @@ class MathsInput(FSLCommandInputSpec): - in_file = File( position=2, argstr="%s", exists=True, mandatory=True, desc="image to operate on" ) @@ -40,12 +39,10 @@ class MathsInput(FSLCommandInputSpec): class MathsOutput(TraitedSpec): - out_file = File(desc="image written after calculations") class MathsCommand(FSLCommand): - _cmd = "fslmaths" input_spec = MathsInput output_spec = MathsOutput @@ -68,7 +65,6 @@ def _gen_filename(self, name): class ChangeDataTypeInput(MathsInput): - _dtypes = ["float", "char", "int", "short", "double", "input"] output_datatype = traits.Enum( *_dtypes, position=-1, argstr="-odt %s", mandatory=True, desc="output data type" @@ -83,7 +79,6 @@ class ChangeDataType(MathsCommand): class ThresholdInputSpec(MathsInput): - thresh = traits.Float( mandatory=True, position=4, argstr="%s", desc="threshold value" ) @@ -126,7 +121,6 @@ def _format_arg(self, name, spec, value): class StdImageInput(MathsInput): - dimension = traits.Enum( "T", "X", @@ -149,7 +143,6 @@ class StdImage(MathsCommand): class MeanImageInput(MathsInput): - dimension = traits.Enum( "T", "X", @@ -170,7 +163,6 @@ class MeanImage(MathsCommand): class MaxImageInput(MathsInput): - dimension = traits.Enum( "T", "X", @@ -202,7 +194,6 @@ class MaxImage(MathsCommand): class PercentileImageInput(MathsInput): - dimension = traits.Enum( "T", "X", @@ -242,7 +233,6 @@ class PercentileImage(MathsCommand): class MaxnImageInput(MathsInput): - dimension = traits.Enum( "T", "X", @@ -266,7 +256,6 @@ class MaxnImage(MathsCommand): class MinImageInput(MathsInput): - dimension = traits.Enum( "T", "X", @@ -287,7 +276,6 @@ class MinImage(MathsCommand): class MedianImageInput(MathsInput): - dimension = traits.Enum( "T", "X", @@ -308,7 +296,6 @@ class MedianImage(MathsCommand): class AR1ImageInput(MathsInput): - dimension = traits.Enum( "T", "X", @@ -332,7 +319,6 @@ class AR1Image(MathsCommand): class IsotropicSmoothInput(MathsInput): - fwhm = traits.Float( mandatory=True, xor=["sigma"], @@ -363,7 +349,6 @@ def _format_arg(self, name, spec, value): class ApplyMaskInput(MathsInput): - mask_file = File( exists=True, mandatory=True, @@ -381,7 +366,6 @@ class ApplyMask(MathsCommand): class KernelInput(MathsInput): - kernel_shape = traits.Enum( "3D", "2D", @@ -412,7 +396,6 @@ class KernelInput(MathsInput): class DilateInput(KernelInput): - operation = traits.Enum( "mean", "modal", @@ -437,7 +420,6 @@ def _format_arg(self, name, spec, value): class ErodeInput(KernelInput): - minimum_filter = traits.Bool( argstr="%s", position=6, @@ -462,7 +444,6 @@ def _format_arg(self, name, spec, value): class SpatialFilterInput(KernelInput): - operation = traits.Enum( "mean", "median", @@ -482,7 +463,6 @@ class SpatialFilter(MathsCommand): class UnaryMathsInput(MathsInput): - operation = traits.Enum( "exp", "log", @@ -525,7 +505,6 @@ def _list_outputs(self): class BinaryMathsInput(MathsInput): - operation = traits.Enum( "add", "sub", @@ -566,7 +545,6 @@ class BinaryMaths(MathsCommand): class MultiImageMathsInput(MathsInput): - op_string = traits.String( position=4, argstr="%s", @@ -605,7 +583,6 @@ def _format_arg(self, name, spec, value): class TemporalFilterInput(MathsInput): - lowpass_sigma = traits.Float( -1, argstr="%.6f", diff --git a/nipype/interfaces/fsl/tests/test_dti.py b/nipype/interfaces/fsl/tests/test_dti.py index 8f5abfc662..0a6a2e8d63 100644 --- a/nipype/interfaces/fsl/tests/test_dti.py +++ b/nipype/interfaces/fsl/tests/test_dti.py @@ -41,7 +41,6 @@ def test_dtifit2(create_files_in_directory): @pytest.mark.xfail(reason="These tests are skipped until we clean up some of this code") def test_randomise2(): - rand = fsl.Randomise() # make sure command gets called @@ -233,7 +232,6 @@ def test_Proj_thresh(): # test vec_reg @pytest.mark.xfail(reason="These tests are skipped until we clean up some of this code") def test_Vec_reg(): - vrg = fsl.VecReg() # make sure command gets called diff --git a/nipype/interfaces/fsl/tests/test_preprocess.py b/nipype/interfaces/fsl/tests/test_preprocess.py index 23ae7a6824..a5752d8d49 100644 --- a/nipype/interfaces/fsl/tests/test_preprocess.py +++ b/nipype/interfaces/fsl/tests/test_preprocess.py @@ -402,7 +402,6 @@ def test_mcflirt_noinput(): @pytest.mark.skipif(no_fsl(), reason="fsl is not installed") def test_fnirt(setup_flirt): - tmpdir, infile, reffile = setup_flirt tmpdir.chdir() fnirt = fsl.FNIRT() @@ -497,7 +496,7 @@ def test_fnirt(setup_flirt): ("log_file", "--logout=%s" % infile, infile), ] - for (name, settings, arg) in opt_map: + for name, settings, arg in opt_map: fnirt = fsl.FNIRT(in_file=infile, ref_file=reffile, **{name: arg}) if name in ("config_file", "affine_file", "field_file", "fieldcoeff_file"): diff --git a/nipype/interfaces/fsl/utils.py b/nipype/interfaces/fsl/utils.py index 4bb44d00b3..734eccc74d 100644 --- a/nipype/interfaces/fsl/utils.py +++ b/nipype/interfaces/fsl/utils.py @@ -482,7 +482,6 @@ class ExtractROI(FSLCommand): output_spec = ExtractROIOutputSpec def _format_arg(self, name, spec, value): - if name == "crop_list": return " ".join(map(str, sum(list(map(list, value)), []))) return super(ExtractROI, self)._format_arg(name, spec, value) @@ -1251,7 +1250,6 @@ def _gen_filename(self, name): class PlotTimeSeriesInputSpec(FSLCommandInputSpec): - in_file = traits.Either( File(exists=True), traits.List(File(exists=True)), @@ -1308,7 +1306,6 @@ class PlotTimeSeriesInputSpec(FSLCommandInputSpec): class PlotTimeSeriesOutputSpec(TraitedSpec): - out_file = File(exists=True, desc="image to write") @@ -1374,7 +1371,6 @@ def _gen_filename(self, name): class PlotMotionParamsInputSpec(FSLCommandInputSpec): - in_file = traits.Either( File(exists=True), traits.List(File(exists=True)), @@ -1406,7 +1402,6 @@ class PlotMotionParamsInputSpec(FSLCommandInputSpec): class PlotMotionParamsOutputSpec(TraitedSpec): - out_file = File(exists=True, desc="image to write") @@ -1443,7 +1438,6 @@ class PlotMotionParams(FSLCommand): output_spec = PlotMotionParamsOutputSpec def _format_arg(self, name, spec, value): - if name == "plot_type": source = self.inputs.in_source @@ -1602,7 +1596,6 @@ def _gen_filename(self, name): class SwapDimensionsInputSpec(FSLCommandInputSpec): - in_file = File( exists=True, mandatory=True, argstr="%s", position="1", desc="input image" ) @@ -1619,7 +1612,6 @@ class SwapDimensionsInputSpec(FSLCommandInputSpec): class SwapDimensionsOutputSpec(TraitedSpec): - out_file = File(exists=True, desc="image with new dimensions") diff --git a/nipype/interfaces/io.py b/nipype/interfaces/io.py index ea06482500..09919e8607 100644 --- a/nipype/interfaces/io.py +++ b/nipype/interfaces/io.py @@ -254,7 +254,6 @@ class DataSinkInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): # Set call-able inputs attributes def __setattr__(self, key, value): - if key not in self.copyable_trait_names(): if not isdefined(value): super(DataSinkInputSpec, self).__setattr__(key, value) @@ -267,7 +266,6 @@ def __setattr__(self, key, value): # DataSink outputs class DataSinkOutputSpec(TraitedSpec): - # Init out file out_file = traits.Any(desc="datasink output") @@ -575,7 +573,6 @@ def _fetch_bucket(self, bucket_name): try: _get_head_bucket(s3_resource, bucket_name) except Exception as exc: - # Try to connect anonymously s3_resource.meta.client.meta.events.register( "choose-signer.s3.*", botocore.handlers.disable_signing @@ -1313,7 +1310,6 @@ def _list_outputs(self): class SelectFilesInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): - base_directory = Directory(exists=True, desc="Root path common to templates.") sort_filelist = traits.Bool( True, @@ -1447,7 +1443,6 @@ def _list_outputs(self): raise ValueError(msg) for field, template in list(self._templates.items()): - find_dirs = template[-1] == os.sep # Build the full template path @@ -1853,7 +1848,6 @@ def _list_outputs(self): class XNATSourceInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): - query_template = Str( mandatory=True, desc=("Layout used to get files. Relative to base " "directory if defined"), @@ -2065,7 +2059,6 @@ def _list_outputs(self): class XNATSinkInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): - _outputs = traits.Dict(Str, value={}, usedefault=True) server = Str(mandatory=True, requires=["user", "pwd"], xor=["config"]) @@ -2154,7 +2147,6 @@ def _list_outputs(self): ) if not shared.exists(): # subject not in share project - share_project = xnat.select("/project/%s" % self.inputs.project_id) if not share_project.exists(): # check project exists @@ -2185,9 +2177,7 @@ def _list_outputs(self): # gather outputs and upload them for key, files in list(self.inputs._outputs.items()): - for name in ensure_list(files): - if isinstance(name, list): for i, file_name in enumerate(name): push_file( @@ -2206,7 +2196,6 @@ def unquote_id(string): def push_file(self, xnat, file_name, out_key, uri_template_args): - # grab info from output file names val_list = [ unquote_id(val) @@ -2269,7 +2258,6 @@ def push_file(self, xnat, file_name, out_key, uri_template_args): # shares the experiment back to the original project if relevant if "original_project" in uri_template_args: - experiment_template = ( "/project/%(original_project)s" "/subject/%(subject_id)s/experiment/%(experiment_id)s" @@ -2318,7 +2306,6 @@ class SQLiteSink(LibraryBaseInterface, IOBase): _pkg = "sqlite3" def __init__(self, input_names, **inputs): - super(SQLiteSink, self).__init__(**inputs) self._input_names = ensure_list(input_names) @@ -2381,7 +2368,6 @@ class MySQLSink(IOBase): input_spec = MySQLSinkInputSpec def __init__(self, input_names, **inputs): - super(MySQLSink, self).__init__(**inputs) self._input_names = ensure_list(input_names) diff --git a/nipype/interfaces/minc/base.py b/nipype/interfaces/minc/base.py index 3de0112614..7fe817dcaa 100644 --- a/nipype/interfaces/minc/base.py +++ b/nipype/interfaces/minc/base.py @@ -80,7 +80,7 @@ def read_hdf5_version(s): versions = {"minc": None, "libminc": None, "netcdf": None, "hdf5": None} for l in out.split("\n"): - for (name, f) in [ + for name, f in [ ("minc", read_program_version), ("libminc", read_libminc_version), ("netcdf", read_netcdf_version), diff --git a/nipype/interfaces/minc/minc.py b/nipype/interfaces/minc/minc.py index 9d28832f50..4e740afab4 100644 --- a/nipype/interfaces/minc/minc.py +++ b/nipype/interfaces/minc/minc.py @@ -3031,7 +3031,6 @@ class Volpad(CommandLine): class VolisoInputSpec(CommandLineInputSpec): - input_file = File( desc="input file to convert to isotropic sampling", exists=True, diff --git a/nipype/interfaces/niftyseg/tests/test_em_interfaces.py b/nipype/interfaces/niftyseg/tests/test_em_interfaces.py index 5615f3e61c..c90d93a6ba 100644 --- a/nipype/interfaces/niftyseg/tests/test_em_interfaces.py +++ b/nipype/interfaces/niftyseg/tests/test_em_interfaces.py @@ -11,7 +11,6 @@ @pytest.mark.skipif(no_nifty_tool(cmd="seg_EM"), reason="niftyseg is not installed") def test_seg_em(): - # Create a node object seg_em = EM() diff --git a/nipype/interfaces/niftyseg/tests/test_extra_PatchMatch.py b/nipype/interfaces/niftyseg/tests/test_extra_PatchMatch.py index 18156e37f1..53d5bd4170 100644 --- a/nipype/interfaces/niftyseg/tests/test_extra_PatchMatch.py +++ b/nipype/interfaces/niftyseg/tests/test_extra_PatchMatch.py @@ -13,7 +13,6 @@ no_nifty_tool(cmd="seg_PatchMatch"), reason="niftyseg is not installed" ) def test_seg_patchmatch(): - # Create a node object seg_patchmatch = PatchMatch() diff --git a/nipype/interfaces/niftyseg/tests/test_lesions.py b/nipype/interfaces/niftyseg/tests/test_lesions.py index d46b380cc2..2daece08cb 100644 --- a/nipype/interfaces/niftyseg/tests/test_lesions.py +++ b/nipype/interfaces/niftyseg/tests/test_lesions.py @@ -13,7 +13,6 @@ no_nifty_tool(cmd="seg_FillLesions"), reason="niftyseg is not installed" ) def test_seg_filllesions(): - # Create a node object seg_fill = FillLesions() diff --git a/nipype/interfaces/niftyseg/tests/test_maths.py b/nipype/interfaces/niftyseg/tests/test_maths.py index 84740b7447..6c0251d7f5 100644 --- a/nipype/interfaces/niftyseg/tests/test_maths.py +++ b/nipype/interfaces/niftyseg/tests/test_maths.py @@ -11,7 +11,6 @@ @pytest.mark.skipif(no_nifty_tool(cmd="seg_maths"), reason="niftyseg is not installed") def test_unary_maths(): - # Create a node object unarym = UnaryMaths() @@ -38,7 +37,6 @@ def test_unary_maths(): @pytest.mark.skipif(no_nifty_tool(cmd="seg_maths"), reason="niftyseg is not installed") def test_binary_maths(): - # Create a node object binarym = BinaryMaths() @@ -65,7 +63,6 @@ def test_binary_maths(): @pytest.mark.skipif(no_nifty_tool(cmd="seg_maths"), reason="niftyseg is not installed") def test_int_binary_maths(): - # Create a node object ibinarym = BinaryMathsInteger() @@ -93,7 +90,6 @@ def test_int_binary_maths(): @pytest.mark.skipif(no_nifty_tool(cmd="seg_maths"), reason="niftyseg is not installed") def test_tuple_maths(): - # Create a node object tuplem = TupleMaths() @@ -124,7 +120,6 @@ def test_tuple_maths(): @pytest.mark.skipif(no_nifty_tool(cmd="seg_maths"), reason="niftyseg is not installed") def test_merge(): - # Create a node object merge = Merge() diff --git a/nipype/interfaces/nitime/analysis.py b/nipype/interfaces/nitime/analysis.py index f6c7aa1f61..d5b6c3a3de 100644 --- a/nipype/interfaces/nitime/analysis.py +++ b/nipype/interfaces/nitime/analysis.py @@ -32,7 +32,6 @@ class CoherenceAnalyzerInputSpec(BaseInterfaceInputSpec): - # Input either csv file, or time-series object and use _xor_inputs to # discriminate _xor_inputs = ("in_file", "in_TS") diff --git a/nipype/interfaces/spm/base.py b/nipype/interfaces/spm/base.py index 2347d718ae..4e9b78e1f1 100644 --- a/nipype/interfaces/spm/base.py +++ b/nipype/interfaces/spm/base.py @@ -201,7 +201,6 @@ def getinfo(klass, matlab_cmd=None, paths=None, use_mcr=None): and klass._command == matlab_cmd and klass._paths == paths ): - return {"name": klass._name, "path": klass._path, "release": klass._version} logger.debug("matlab command or path has changed. recomputing version.") mlab = MatlabCommand(matlab_cmd=matlab_cmd, resource_monitor=False) diff --git a/nipype/interfaces/spm/preprocess.py b/nipype/interfaces/spm/preprocess.py index dbafdcd18d..a612865039 100644 --- a/nipype/interfaces/spm/preprocess.py +++ b/nipype/interfaces/spm/preprocess.py @@ -39,7 +39,6 @@ class FieldMapInputSpec(SPMCommandInputSpec): - jobtype = traits.Enum( "calculatevdm", usedefault=True, @@ -235,7 +234,6 @@ def _format_arg(self, opt, spec, val): """Convert input to appropriate format for spm""" if opt in ["phase_file", "magnitude_file", "anat_file", "epi_file"]: - return scans_for_fname(ensure_list(val)) return super(FieldMap, self)._format_arg(opt, spec, val) @@ -256,7 +254,6 @@ def _list_outputs(self): class ApplyVDMInputSpec(SPMCommandInputSpec): - in_files = InputMultiObject( ImageFileSPM(exists=True), field="data.scans", @@ -674,7 +671,6 @@ def _list_outputs(self): class RealignUnwarpInputSpec(SPMCommandInputSpec): - in_files = InputMultiObject( traits.Either( ImageFileSPM(exists=True), traits.List(ImageFileSPM(exists=True)) @@ -879,7 +875,6 @@ def _format_arg(self, opt, spec, val): return super(RealignUnwarp, self)._format_arg(opt, spec, val) def _parse_inputs(self, skip=()): - spmdict = super(RealignUnwarp, self)._parse_inputs(skip=())[0] if isdefined(self.inputs.phase_map): @@ -2681,7 +2676,6 @@ def _list_outputs(self): class VBMSegmentInputSpec(SPMCommandInputSpec): - in_files = InputMultiPath( ImageFileSPM(exists=True), desc="A list of files to be segmented", @@ -2851,7 +2845,6 @@ class VBMSegmentInputSpec(SPMCommandInputSpec): class VBMSegmentOuputSpec(TraitedSpec): - native_class_images = traits.List( traits.List(File(exists=True)), desc="native space probability maps" ) diff --git a/nipype/interfaces/spm/utils.py b/nipype/interfaces/spm/utils.py index 543a0d3024..1c9e506d57 100644 --- a/nipype/interfaces/spm/utils.py +++ b/nipype/interfaces/spm/utils.py @@ -24,7 +24,6 @@ class Analyze2niiOutputSpec(SPMCommandInputSpec): class Analyze2nii(SPMCommand): - input_spec = Analyze2niiInputSpec output_spec = Analyze2niiOutputSpec diff --git a/nipype/interfaces/tests/test_io.py b/nipype/interfaces/tests/test_io.py index 45bd53e32c..2df5c9dad8 100644 --- a/nipype/interfaces/tests/test_io.py +++ b/nipype/interfaces/tests/test_io.py @@ -571,7 +571,6 @@ def test_freesurfersource_incorrectdir(): def test_jsonsink_input(): - ds = nio.JSONFileSink() assert ds.inputs._outputs == {} diff --git a/nipype/interfaces/tests/test_nilearn.py b/nipype/interfaces/tests/test_nilearn.py index 4f94bbb87b..29a068552c 100644 --- a/nipype/interfaces/tests/test_nilearn.py +++ b/nipype/interfaces/tests/test_nilearn.py @@ -22,7 +22,6 @@ @pytest.mark.skipif(no_nilearn, reason="the nilearn library is not available") class TestSignalExtraction: - filenames = { "in_file": "fmri.nii", "label_files": "labels.nii", diff --git a/nipype/pipeline/engine/tests/test_engine.py b/nipype/pipeline/engine/tests/test_engine.py index a44922910d..2df8f0b233 100644 --- a/nipype/pipeline/engine/tests/test_engine.py +++ b/nipype/pipeline/engine/tests/test_engine.py @@ -196,7 +196,6 @@ def test_synchronize_tuples_expansion(): def test_itersource_expansion(): - wf1 = pe.Workflow(name="test") node1 = pe.Node(EngineTestInterface(), name="node1") node1.iterables = ("input1", [1, 2]) diff --git a/nipype/pipeline/engine/tests/test_workflows.py b/nipype/pipeline/engine/tests/test_workflows.py index c6170f7ba8..ab6ad663fd 100644 --- a/nipype/pipeline/engine/tests/test_workflows.py +++ b/nipype/pipeline/engine/tests/test_workflows.py @@ -100,7 +100,6 @@ def test_nested_workflow_doubleconnect(): def test_duplicate_node_check(): - wf = pe.Workflow(name="testidentity") original_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] diff --git a/nipype/pipeline/plugins/slurm.py b/nipype/pipeline/plugins/slurm.py index 44cdac70d5..c06444a02e 100644 --- a/nipype/pipeline/plugins/slurm.py +++ b/nipype/pipeline/plugins/slurm.py @@ -31,7 +31,6 @@ class SLURMPlugin(SGELikeBatchManagerBase): """ def __init__(self, **kwargs): - template = "#!/bin/bash" self._retry_timeout = 2 diff --git a/nipype/pipeline/plugins/tests/test_legacymultiproc_nondaemon.py b/nipype/pipeline/plugins/tests/test_legacymultiproc_nondaemon.py index 5f33b025b2..4e44c801ec 100644 --- a/nipype/pipeline/plugins/tests/test_legacymultiproc_nondaemon.py +++ b/nipype/pipeline/plugins/tests/test_legacymultiproc_nondaemon.py @@ -50,7 +50,6 @@ def dummyFunction(filename): f.write(str(j)) for n in range(numberOfThreads): - # mark thread as alive a[n] = True @@ -64,11 +63,9 @@ def dummyFunction(filename): # block until all processes are done allDone = False while not allDone: - time.sleep(1) for n in range(numberOfThreads): - a[n] = t[n].is_alive() if not any(a): diff --git a/nipype/tests/test_nipype.py b/nipype/tests/test_nipype.py index 9ac517f9d7..3f103b5529 100644 --- a/nipype/tests/test_nipype.py +++ b/nipype/tests/test_nipype.py @@ -51,7 +51,6 @@ def test_no_et_bare(tmp_path): # Pytest doesn't trigger this, so let's pretend it's there with patch.object(BaseInterface, "_etelemetry_version_data", {}): - # Direct function call - environment not set f = niu.Function(function=_check_no_et) res = f.run() @@ -87,7 +86,6 @@ def test_no_et_multiproc(tmp_path, plugin, run_without_submitting): # Pytest doesn't trigger this, so let's pretend it's there with patch.object(BaseInterface, "_etelemetry_version_data", {}): - wf = pe.Workflow(name="wf2", base_dir=str(tmp_path)) n = pe.Node( niu.Function(function=_check_no_et), diff --git a/nipype/utils/nipype_cmd.py b/nipype/utils/nipype_cmd.py index 7cfff832c1..76717bf168 100644 --- a/nipype/utils/nipype_cmd.py +++ b/nipype/utils/nipype_cmd.py @@ -61,7 +61,6 @@ def run_instance(interface, options): def main(argv): - if len(argv) == 2 and not argv[1].startswith("-"): listClasses(argv[1]) sys.exit(0) diff --git a/nipype/utils/tests/test_filemanip.py b/nipype/utils/tests/test_filemanip.py index 8d4597317c..91f0e1f229 100644 --- a/nipype/utils/tests/test_filemanip.py +++ b/nipype/utils/tests/test_filemanip.py @@ -612,7 +612,6 @@ def test_versioned_pklization(tmpdir): with mock.patch( "nipype.utils.tests.test_filemanip.Pickled", PickledBreaker ), mock.patch("nipype.__version__", "0.0.0"): - loadpkl("./pickled.pkz") From 756d11cf02a3041550ac78dd01e3834b1071dc59 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Wed, 5 Apr 2023 14:11:18 -0400 Subject: [PATCH 20/33] MNT: Add .git-blame-ignore-revs make rule --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 03c1152053..568d53379c 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,10 @@ PYTHON ?= python zipdoc: html zip documentation.zip doc/_build/html +.git-blame-ignore-revs: .git/HEAD + git log --grep "\[ignore-rev\]\|STY: black\|run black" -i --pretty=format:"# %ad - %ae - %s%n%H" > .git-blame-ignore-revs + echo >> .git-blame-ignore-revs + sdist: zipdoc @echo "Building source distribution..." $(PYTHON) setup.py sdist From ec5b7989fb0b1484a262e688caa8a3890e868f1f Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Wed, 5 Apr 2023 14:11:44 -0400 Subject: [PATCH 21/33] MNT: Update .git-blame-ignore-revs --- .git-blame-ignore-revs | 63 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 4c410e9b0d..8c1e119249 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1,19 +1,80 @@ -# Commits with messages like "STY: black" or "run black" +# Wed Apr 5 14:01:05 2023 -0400 - effigies@gmail.com - STY: black [ignore-rev] +a9ce9b78a402ebacf7726ad6454bb75b1447f52f +# Wed Sep 14 14:12:07 2022 -0400 - mathiasg@stanford.edu - STY: Black +f4a779223c6b0dffa47138d24ec9ef378c7164a9 +# Tue Apr 19 14:09:31 2022 -0400 - markiewicz@stanford.edu - STY: black [ignore-rev] +b9716ebd46541f7fb1b96a94cc35b5e2ea6c3bba +# Fri Apr 15 06:59:48 2022 -0700 - markiewicz@stanford.edu - STY: black [ignore-rev] +d223fbccda6dee0ef39e00084296a3292f2ccf87 +# Fri Apr 8 21:34:43 2022 -0400 - markiewicz@stanford.edu - STY: black [ignore-rev] +e3f56da124fd58041018c2e70d16a130ef189a66 +# Sun Apr 3 10:27:07 2022 -0400 - markiewicz@stanford.edu - STY: black [ignore-rev] +988c382ebfc7df964874b6287b9d9e27e274a4a4 +# Sat Apr 2 21:32:56 2022 -0400 - markiewicz@stanford.edu - STY: black [ignore-rev] +230fac6149d4dfbd5da669a983332a1fe318ef57 +# Sat Apr 2 12:49:15 2022 -0400 - markiewicz@stanford.edu - STY/TEST: Make specs and run black [ignore-rev] +2ba8dacb8cc1f6f9c5b15b1cfb7b0395d45dcfb3 +# Sun Mar 20 21:19:39 2022 -0400 - markiewicz@stanford.edu - STY: black [ignore-rev] +87cc1b54981113024ec3fd594881f72cf67513fb +# Wed Dec 8 17:02:09 2021 -0500 - markiewicz@stanford.edu - STY: black [ignore-rev] +5ac2f18ac116832d81a13f0c83e0a6aeda1457cf +# Thu Dec 2 09:30:42 2021 -0500 - markiewicz@stanford.edu - STY: black +ee50279ebf061a70ff502e7d2e51385b285cfda4 +# Tue Oct 26 11:18:02 2021 +0200 - code@oscaresteban.es - sty: run black +5d9adbbb77b7047b9b47cd2fa079dee0094cfc91 +# Wed Oct 20 12:07:15 2021 +0200 - fabio.bernardoni@uniklinikum-dresden.de - run black on the preprocess.py file to improve formatting +674e9b0eeca082efb5322b61fea57ee89a3e4a24 +# Wed Oct 13 16:08:23 2021 -0400 - markiewicz@stanford.edu - ENH: Add expected steps for FreeSurfer 7 recon-all (#3389) +8f7c0bf2ec9c819844a2736a9ae2f6eef19a8e7f +# Wed Oct 13 14:26:48 2021 -0400 - markiewicz@stanford.edu - STY: black +d8dbc6f7b6a5385535e2fa53b7c6af7aa1370f46 +# Wed Sep 29 16:53:54 2021 +0200 - code@oscaresteban.es - sty: run black on affected files +5f280da629bb7b5dce908633d2deea85b55dd67b +# Thu Jun 24 17:43:22 2021 +0200 - code@oscaresteban.es - sty: run black +135ce497a18adbe0811441c2b720910ec549aa6f +# Thu Sep 23 08:56:28 2021 -0400 - markiewicz@stanford.edu - STY: black +f69b3fb09560616822737764bb07272cd587e4a0 +# Fri Apr 30 17:19:55 2021 -0400 - markiewicz@stanford.edu - STY: black +04718ac71436b6f283af7575dda0f6998b64f893 +# Fri Apr 30 16:50:00 2021 -0400 - markiewicz@stanford.edu - STY: black 12deb959cccc431fb8222cc5854f1c92a0080021 +# Thu Apr 1 12:26:08 2021 -0400 - markiewicz@stanford.edu - STY: black f64bf338f630a9ee5cbe7a3ec98c68292897e720 +# Thu Dec 3 09:24:05 2020 +1100 - tom.g.close@gmail.com - run black over touched files +c81259bc3b28baa1f18f95f6b056c228c6bfd115 +# Fri Aug 14 17:15:15 2020 -0400 - markiewicz@stanford.edu - STY: Black 83358d7f17aac07cb90d0330f11ea2322e2974d8 +# Sat Mar 14 12:44:20 2020 -0400 - markiewicz@stanford.edu - STY: black faef7d0f93013a700c882f709e98fb3cd36ebb03 +# Sun Mar 8 15:05:28 2020 +0100 - 3453485+daniel-ge@users.noreply.github.com - FIX: get length of generator + STY: Black +02991da67458b879d7c6360aa6457eb3c1bd5a07 +# Wed Mar 4 16:30:39 2020 -0500 - markiewicz@stanford.edu - STY: black d50c1858564c0b3073fb23c54886a0454cb66afa +# Thu Feb 27 15:08:42 2020 -0800 - code@oscaresteban.es - sty: black 417b8897a116fcded5000e21e2b6ccbe29452a52 +# Thu Jan 2 11:29:05 2020 -0800 - code@oscaresteban.es - sty: black aaf677a87f64c485f3e305799e4a5dc73b69e5fb +# Sun Dec 29 17:47:51 2019 -0800 - code@oscaresteban.es - sty: black f763008442d88d8ce00ec266698268389415f8d6 +# Thu Jan 2 11:29:05 2020 -0800 - code@oscaresteban.es - sty: black b1eccafd4edc8503b02d715f5b5f6f783520fdf9 +# Sun Dec 29 17:47:51 2019 -0800 - code@oscaresteban.es - sty: black 70db90349598cc7f26a4a513779529fba7d0a797 +# Thu Dec 19 09:22:22 2019 -0500 - markiewicz@stanford.edu - STY: Black 6c1d91d71f6f0db0e985bd2adc34206442b0653d +# Thu Dec 19 15:51:11 2019 -0500 - markiewicz@stanford.edu - STY: Black 97bdbd5f48ab242de5288ba4715192a27619a803 +# Fri Nov 15 14:38:10 2019 -0500 - steve@steventilley.com - run black 78fa360f5b785224349b8b85b07e510d2233bb63 +# Fri Nov 15 14:34:03 2019 -0500 - steve@steventilley.com - run black 7f85f43a34de8bff8e634232c939b17cee8e8fc5 +# Thu Nov 14 11:14:51 2019 -0500 - markiewicz@stanford.edu - Merge pull request #3096 from effigies/sty/black +1a869991adc024577536689d557fc748c764f15d +# Thu Nov 14 09:15:20 2019 -0500 - markiewicz@stanford.edu - STY: Black setup.py 9c50b5daa797def5672dd057155b0e2c658853e2 +# Thu Nov 14 09:14:38 2019 -0500 - markiewicz@stanford.edu - STY: Black for tools/ 47194993ae14aceeec436cfb3769def667196668 +# Wed Nov 13 23:41:15 2019 -0500 - markiewicz@stanford.edu - STY: Black 75653feadc6667d5313d83e9c62a5d5819771a9c +# Tue Nov 12 09:43:34 2019 -0500 - markiewicz@stanford.edu - STY: Black files pre-merge 497b44d680eee0892fa59c6aaaae22a17d70a536 From f13633e2c4a7e8d9aa18506eb803a5f8013ce9e1 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Wed, 5 Apr 2023 14:24:22 -0400 Subject: [PATCH 22/33] DOC: 1.8.6 changelog --- doc/changelog/1.X.X-changelog.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/doc/changelog/1.X.X-changelog.rst b/doc/changelog/1.X.X-changelog.rst index f6a9233f5e..34ff8392ea 100644 --- a/doc/changelog/1.X.X-changelog.rst +++ b/doc/changelog/1.X.X-changelog.rst @@ -1,3 +1,20 @@ +1.8.6 (April 05, 2023) +====================== + +Bug-fix release in the 1.8.x series. + + * FIX: Update dcmstack interface for Py3 / newer pydicom (https://github.com/nipy/nipype/pull/3541) + * FIX: NiBabel 5, and NetworkX 3 and DIPY 1.6 compatibility (https://github.com/nipy/nipype/pull/3538) + * FIX: Check for non-mandatory output in DWIBiasCorrect (https://github.com/nipy/nipype/pull/3523) + * FIX: Removed leftover debug print statement in FEAT class (https://github.com/nipy/nipype/pull/3521) + * DOC: Fix a few more typos (https://github.com/nipy/nipype/pull/3516) + * DOC: Fix typos found by codespell (https://github.com/nipy/nipype/pull/3512) + * CI: Drop nipy tests until a fixed nipy is released (https://github.com/nipy/nipype/pull/3559) + * CI: Disable nipy tests generally, re-add with max numpy (https://github.com/nipy/nipype/pull/3532) + * CI: GitHub Workflows security hardening (https://github.com/nipy/nipype/pull/3519) + * CI: Allow tutorial test cancellation (https://github.com/nipy/nipype/pull/3514) + + 1.8.5 (September 21, 2022) ========================== From 105e9a328d630b9a36d6d57676c5cd9029a289d5 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Wed, 5 Apr 2023 14:25:00 -0400 Subject: [PATCH 23/33] DOC: Update zenodo ordering --- .zenodo.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.zenodo.json b/.zenodo.json index fd9e5e9658..3bee5d5790 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -116,15 +116,15 @@ { "name": "Yvernault, Benjamin" }, - { - "name": "Hamalainen, Carlo", - "orcid": "0000-0001-7655-3830" - }, { "affiliation": "Institute for Biomedical Engineering, ETH and University of Zurich", "name": "Christian, Horea", "orcid": "0000-0001-7037-2449" }, + { + "name": "Hamalainen, Carlo", + "orcid": "0000-0001-7655-3830" + }, { "affiliation": "Stanford University", "name": "Ćirić , Rastko", @@ -193,6 +193,9 @@ "name": "Dias, Maria de Fatima", "orcid": "0000-0001-8878-1750" }, + { + "name": "Moloney, Brendan" + }, { "affiliation": "Otto-von-Guericke-University Magdeburg, Germany", "name": "Hanke, Michael", @@ -202,9 +205,6 @@ "affiliation": "Child Mind Institute", "name": "Giavasis, Steven" }, - { - "name": "Moloney, Brendan" - }, { "affiliation": "SRI International", "name": "Nichols, B. Nolan", @@ -363,6 +363,11 @@ "name": "Schaefer, Alexander", "orcid": "0000-0001-6488-4739" }, + { + "affiliation": "CEA", + "name": "Papadopoulos Orfanos, Dimitri", + "orcid": "0000-0002-1242-8990" + }, { "affiliation": "UniversityHospital Heidelberg, Germany", "name": "Kleesiek, Jens" @@ -414,11 +419,6 @@ { "name": "Haselgrove, Christian" }, - { - "affiliation": "CEA", - "name": "Papadopoulos Orfanos, Dimitri", - "orcid": "0000-0002-1242-8990" - }, { "affiliation": "Department of Psychology, Stanford University; Parietal, INRIA", "name": "Durnez, Joke", From 22858593d13d6001dcc8a31afe4f3a15bcad9e0a Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Wed, 5 Apr 2023 14:28:15 -0400 Subject: [PATCH 24/33] MNT: Bump version to 1.8.6 --- nipype/info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nipype/info.py b/nipype/info.py index a7ea648c3d..3c8e8ee596 100644 --- a/nipype/info.py +++ b/nipype/info.py @@ -5,7 +5,7 @@ # nipype version information # Remove .dev0 for release -__version__ = "1.8.6.dev0" +__version__ = "1.8.6" def get_nipype_gitversion(): From 2086876aa147b9d9e274fbec995c5e2a970966db Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Thu, 6 Apr 2023 08:43:20 -0400 Subject: [PATCH 25/33] MNT: 1.8.7.dev0 --- doc/interfaces.rst | 2 +- nipype/info.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/interfaces.rst b/doc/interfaces.rst index e9fe73f562..e7b9dca2f4 100644 --- a/doc/interfaces.rst +++ b/doc/interfaces.rst @@ -8,7 +8,7 @@ Interfaces and Workflows :Release: |version| :Date: |today| -Previous versions: `1.8.5 `_ `1.8.4 `_ +Previous versions: `1.8.6 `_ `1.8.5 `_ Workflows --------- diff --git a/nipype/info.py b/nipype/info.py index 3c8e8ee596..b6e6245511 100644 --- a/nipype/info.py +++ b/nipype/info.py @@ -5,7 +5,7 @@ # nipype version information # Remove .dev0 for release -__version__ = "1.8.6" +__version__ = "1.8.7.dev0" def get_nipype_gitversion(): From 242b57272545d9369e3c9b2d0fc73ce6f9413df9 Mon Sep 17 00:00:00 2001 From: Austin Macdonald Date: Thu, 6 Apr 2023 14:57:31 -0400 Subject: [PATCH 26/33] Stop using deprecated import internally --- nipype/__init__.py | 2 +- nipype/interfaces/afni/base.py | 4 +++- nipype/interfaces/base/core.py | 4 +++- nipype/interfaces/freesurfer/base.py | 3 ++- nipype/interfaces/freesurfer/preprocess.py | 3 ++- nipype/interfaces/freesurfer/tests/test_preprocess.py | 4 ++-- nipype/interfaces/fsl/model.py | 2 +- nipype/interfaces/fsl/preprocess.py | 2 +- nipype/interfaces/image.py | 3 ++- nipype/interfaces/mrtrix3/base.py | 4 +++- nipype/interfaces/tests/test_image.py | 2 +- 11 files changed, 21 insertions(+), 12 deletions(-) diff --git a/nipype/__init__.py b/nipype/__init__.py index 06084e823a..1d63d5b4ae 100644 --- a/nipype/__init__.py +++ b/nipype/__init__.py @@ -13,7 +13,7 @@ """ import os -# XXX Deprecate this import +# XXX Deprecated import. Not used internally but could be used externally. from looseversion import LooseVersion from .info import URL as __url__, STATUS as __status__, __version__ diff --git a/nipype/interfaces/afni/base.py b/nipype/interfaces/afni/base.py index 28dc1dc410..e3b910f8c5 100644 --- a/nipype/interfaces/afni/base.py +++ b/nipype/interfaces/afni/base.py @@ -6,7 +6,9 @@ from sys import platform import shutil -from ... import logging, LooseVersion +from looseversion import LooseVersion + +from ... import logging from ...utils.filemanip import split_filename, fname_presuffix from ..base import ( CommandLine, diff --git a/nipype/interfaces/base/core.py b/nipype/interfaces/base/core.py index 81da68be00..fd2e2c54ca 100644 --- a/nipype/interfaces/base/core.py +++ b/nipype/interfaces/base/core.py @@ -16,7 +16,9 @@ import simplejson as json from traits.trait_errors import TraitError -from ... import config, logging, LooseVersion +from looseversion import LooseVersion + +from ... import config, logging from ...utils.provenance import write_provenance from ...utils.misc import str2bool from ...utils.filemanip import ( diff --git a/nipype/interfaces/freesurfer/base.py b/nipype/interfaces/freesurfer/base.py index 9527e97192..6e9bb5942d 100644 --- a/nipype/interfaces/freesurfer/base.py +++ b/nipype/interfaces/freesurfer/base.py @@ -16,7 +16,8 @@ """ import os -from ... import LooseVersion +from looseversion import LooseVersion + from ...utils.filemanip import fname_presuffix from ..base import ( CommandLine, diff --git a/nipype/interfaces/freesurfer/preprocess.py b/nipype/interfaces/freesurfer/preprocess.py index ccf783a1e3..6970a70ce5 100644 --- a/nipype/interfaces/freesurfer/preprocess.py +++ b/nipype/interfaces/freesurfer/preprocess.py @@ -9,10 +9,11 @@ import shutil import sys +from looseversion import LooseVersion import numpy as np from nibabel import load -from ... import logging, LooseVersion +from ... import logging from ...utils.filemanip import fname_presuffix, check_depends from ..io import FreeSurferSource from ..base import ( diff --git a/nipype/interfaces/freesurfer/tests/test_preprocess.py b/nipype/interfaces/freesurfer/tests/test_preprocess.py index 9743f7bf95..00df9393b6 100644 --- a/nipype/interfaces/freesurfer/tests/test_preprocess.py +++ b/nipype/interfaces/freesurfer/tests/test_preprocess.py @@ -4,11 +4,11 @@ import os import pytest -from nipype.testing.fixtures import create_files_in_directory +from looseversion import LooseVersion +from nipype.testing.fixtures import create_files_in_directory from nipype.interfaces import freesurfer from nipype.interfaces.freesurfer import Info -from nipype import LooseVersion @pytest.mark.skipif(freesurfer.no_freesurfer(), reason="freesurfer is not installed") diff --git a/nipype/interfaces/fsl/model.py b/nipype/interfaces/fsl/model.py index 50485bac2e..dd8f9adeef 100644 --- a/nipype/interfaces/fsl/model.py +++ b/nipype/interfaces/fsl/model.py @@ -11,9 +11,9 @@ from string import Template import numpy as np +from looseversion import LooseVersion from nibabel import load -from ... import LooseVersion from ...utils.filemanip import simplify_list, ensure_list from ...utils.misc import human_order_sorted from ...external.due import BibTeX diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index 80ef25534a..d1cee1744e 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -11,8 +11,8 @@ import numpy as np from nibabel import load +from looseversion import LooseVersion -from ... import LooseVersion from ...utils.filemanip import split_filename from ..base import ( TraitedSpec, diff --git a/nipype/interfaces/image.py b/nipype/interfaces/image.py index 8ea33647c5..1535b1baf8 100644 --- a/nipype/interfaces/image.py +++ b/nipype/interfaces/image.py @@ -4,7 +4,8 @@ from ..utils.filemanip import fname_presuffix from .base import SimpleInterface, TraitedSpec, BaseInterfaceInputSpec, traits, File -from .. import LooseVersion + +from looseversion import LooseVersion class RescaleInputSpec(BaseInterfaceInputSpec): diff --git a/nipype/interfaces/mrtrix3/base.py b/nipype/interfaces/mrtrix3/base.py index af96b5a9f3..1a0ad94c4d 100644 --- a/nipype/interfaces/mrtrix3/base.py +++ b/nipype/interfaces/mrtrix3/base.py @@ -2,7 +2,9 @@ # vi: set ft=python sts=4 ts=4 sw=4 et: # -*- coding: utf-8 -*- -from ... import logging, LooseVersion +from looseversion import LooseVersion + +from ... import logging from ...utils.filemanip import which from ..base import ( CommandLineInputSpec, diff --git a/nipype/interfaces/tests/test_image.py b/nipype/interfaces/tests/test_image.py index d1ed2578a6..43e0cd0648 100644 --- a/nipype/interfaces/tests/test_image.py +++ b/nipype/interfaces/tests/test_image.py @@ -4,10 +4,10 @@ import nibabel as nb import pytest +from looseversion import LooseVersion from nibabel.orientations import axcodes2ornt, ornt_transform from ..image import _as_reoriented_backport, _orientations -from ... import LooseVersion nibabel24 = LooseVersion(nb.__version__) >= LooseVersion("2.4.0") From f877dea1584a3bf04654ba681d7aeb3ad1d15c49 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Mon, 17 Apr 2023 08:31:13 -0400 Subject: [PATCH 27/33] Unmark import as to-deprecate --- nipype/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nipype/__init__.py b/nipype/__init__.py index 1d63d5b4ae..09728b62d1 100644 --- a/nipype/__init__.py +++ b/nipype/__init__.py @@ -13,7 +13,7 @@ """ import os -# XXX Deprecated import. Not used internally but could be used externally. +# No longer used internally but could be used externally. from looseversion import LooseVersion from .info import URL as __url__, STATUS as __status__, __version__ From 318f17900dbb6602ef6ac48b75adfe1449e82c8a Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Mon, 17 Apr 2023 08:32:08 -0400 Subject: [PATCH 28/33] Better rename: testin -> test_in --- nipype/interfaces/tests/test_io.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nipype/interfaces/tests/test_io.py b/nipype/interfaces/tests/test_io.py index 400ee7cabc..635c90cef1 100644 --- a/nipype/interfaces/tests/test_io.py +++ b/nipype/interfaces/tests/test_io.py @@ -708,10 +708,10 @@ def _mock_get_ssh_client(self): def test_ExportFile(tmp_path): - testing = tmp_path / "in.txt" - testing.write_text("test string", encoding='utf-8') + test_in = tmp_path / "in.txt" + test_in.write_text("test string", encoding='utf-8') i = nio.ExportFile() - i.inputs.in_file = str(testing) + i.inputs.in_file = str(test_in) i.inputs.out_file = str(tmp_path / "out.tsv") i.inputs.check_extension = True with pytest.raises(RuntimeError): From fc8cae793b480b97c96fcb54e02bca67d2df5883 Mon Sep 17 00:00:00 2001 From: Yibei Chen Date: Tue, 9 May 2023 19:43:17 -0700 Subject: [PATCH 29/33] remove redundant out_shell_pe_translation_parameters --- nipype/interfaces/fsl/epi.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/nipype/interfaces/fsl/epi.py b/nipype/interfaces/fsl/epi.py index 99ba0fce0b..26ce76ca4a 100644 --- a/nipype/interfaces/fsl/epi.py +++ b/nipype/interfaces/fsl/epi.py @@ -851,12 +851,6 @@ class EddyOutputSpec(TraitedSpec): "between the different shells as estimated by a " "post-hoc mutual information based registration", ) - out_shell_pe_translation_parameters = File( - exists=True, - desc="Text file containing translation along the PE-direction " - "between the different shells as estimated by a " - "post-hoc mutual information based registration", - ) out_outlier_map = File( exists=True, desc="Matrix where rows represent volumes and columns represent " From 46cf9a9b11934efd9beeb4f358524e42f33e7e78 Mon Sep 17 00:00:00 2001 From: Martin Norgaard Date: Wed, 17 May 2023 09:43:00 +0200 Subject: [PATCH 30/33] FIX: update sefl.inputs.optimization in outputs for GTMPVC --- nipype/interfaces/freesurfer/petsurfer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nipype/interfaces/freesurfer/petsurfer.py b/nipype/interfaces/freesurfer/petsurfer.py index 33602d2711..272cba6e21 100644 --- a/nipype/interfaces/freesurfer/petsurfer.py +++ b/nipype/interfaces/freesurfer/petsurfer.py @@ -557,7 +557,7 @@ def _list_outputs(self): outputs["rbv"] = os.path.join(pvcdir, "rbv.nii.gz") outputs["reg_rbvpet2anat"] = os.path.join(pvcdir, "aux", "rbv2anat.lta") outputs["reg_anat2rbvpet"] = os.path.join(pvcdir, "aux", "anat2rbv.lta") - if self.inputs.opt: + if self.inputs.optimization_schema: outputs["opt_params"] = os.path.join(pvcdir, "aux", "opt.params.dat") return outputs From 6cbbaffa0c2b639fc804cecb7dfa7778b21dfdc5 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Wed, 17 May 2023 09:06:30 -0400 Subject: [PATCH 31/33] FIX: Style/specs --- .gitignore | 2 +- nipype/interfaces/spm/tests/test_auto_Threshold.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f75fe9ef6e..b2556cb084 100644 --- a/.gitignore +++ b/.gitignore @@ -30,4 +30,4 @@ __pycache__/ .ruby-version .pytest_cache .vscode/ -venv/ \ No newline at end of file +venv/ diff --git a/nipype/interfaces/spm/tests/test_auto_Threshold.py b/nipype/interfaces/spm/tests/test_auto_Threshold.py index 470ae7f2d1..128ab0586c 100644 --- a/nipype/interfaces/spm/tests/test_auto_Threshold.py +++ b/nipype/interfaces/spm/tests/test_auto_Threshold.py @@ -48,6 +48,9 @@ def test_Threshold_inputs(): min_ver="8", usedefault=True, ), + use_vox_fdr_correction=dict( + usedefault=True, + ), ) inputs = Threshold.input_spec() From c8f4c429b6c45deedad97aef7e85d48047b943a6 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Sun, 28 May 2023 13:27:54 +0200 Subject: [PATCH 32/33] =?UTF-8?q?[REF]=20io.open()=20=E2=86=92=20open()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nipype/sphinxext/plot_workflow.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nipype/sphinxext/plot_workflow.py b/nipype/sphinxext/plot_workflow.py index 6765046d05..a61a29c5ad 100644 --- a/nipype/sphinxext/plot_workflow.py +++ b/nipype/sphinxext/plot_workflow.py @@ -273,7 +273,7 @@ def run(self): else: function_name = None - with io.open(source_file_name, "r", encoding="utf-8") as fd: + with open(source_file_name, "r", encoding="utf-8") as fd: code = fd.read() output_base = os.path.basename(source_file_name) else: @@ -438,7 +438,7 @@ def run(self): # copy script (if necessary) target_name = os.path.join(dest_dir, output_base + source_ext) - with io.open(target_name, "w", encoding="utf-8") as f: + with open(target_name, "w", encoding="utf-8") as f: if source_file_name == rst_file: code_escaped = unescape_doctest(code) else: From 4a6a7d9d25d5d1e1f0eb55828dede58f8b9c9f80 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Wed, 5 Jul 2023 09:49:31 -0400 Subject: [PATCH 33/33] STY: black --- doc/devel/matlab_example1.py | 17 +++++++++++------ doc/devel/matlab_example2.py | 8 +++++--- tools/checkspecs.py | 15 +++++++-------- tools/gitwash_dumper.py | 6 ++---- tools/run_examples.py | 12 +++++++++--- 5 files changed, 34 insertions(+), 24 deletions(-) diff --git a/doc/devel/matlab_example1.py b/doc/devel/matlab_example1.py index aaf6c4cb3a..12d1a1302a 100644 --- a/doc/devel/matlab_example1.py +++ b/doc/devel/matlab_example1.py @@ -1,6 +1,10 @@ from nipype.interfaces.matlab import MatlabCommand -from nipype.interfaces.base import TraitedSpec, \ - BaseInterface, BaseInterfaceInputSpec, File +from nipype.interfaces.base import ( + TraitedSpec, + BaseInterface, + BaseInterfaceInputSpec, + File, +) import os from string import Template @@ -19,14 +23,15 @@ class ConmapTxt2Mat(BaseInterface): output_spec = ConmapTxt2MatOutputSpec def _run_interface(self, runtime): - d = dict(in_file=self.inputs.in_file, - out_file=self.inputs.out_file) + d = dict(in_file=self.inputs.in_file, out_file=self.inputs.out_file) # This is your MATLAB code template - script = Template("""in_file = '$in_file'; + script = Template( + """in_file = '$in_file'; out_file = '$out_file'; ConmapTxt2Mat(in_file, out_file); exit; - """).substitute(d) + """ + ).substitute(d) # mfile = True will create an .m file with your script and executed. # Alternatively diff --git a/doc/devel/matlab_example2.py b/doc/devel/matlab_example2.py index 8d683ea45f..224dc45d8c 100644 --- a/doc/devel/matlab_example2.py +++ b/doc/devel/matlab_example2.py @@ -4,8 +4,7 @@ class HelloWorldInputSpec(MatlabInputSpec): - name = traits.Str(mandatory=True, - desc='Name of person to say hello to') + name = traits.Str(mandatory=True, desc='Name of person to say hello to') class HelloWorldOutputSpec(TraitedSpec): @@ -29,6 +28,7 @@ class HelloWorld(MatlabCommand): >>> out = hello.run() >>> print out.outputs.matlab_output """ + input_spec = HelloWorldInputSpec output_spec = HelloWorldOutputSpec @@ -37,7 +37,9 @@ def _my_script(self): script = """ disp('Hello %s Python') two = 1 + 1 - """ % (self.inputs.name) + """ % ( + self.inputs.name + ) return script def run(self, **inputs): diff --git a/tools/checkspecs.py b/tools/checkspecs.py index 032fd122cc..7aaac0d107 100644 --- a/tools/checkspecs.py +++ b/tools/checkspecs.py @@ -13,8 +13,7 @@ # Functions and classes class InterfaceChecker(object): - """Class for checking all interface specifications - """ + """Class for checking all interface specifications""" def __init__( self, @@ -23,7 +22,7 @@ def __init__( module_skip_patterns=None, class_skip_patterns=None, ): - r""" Initialize package for parsing + r"""Initialize package for parsing Parameters ---------- @@ -113,14 +112,14 @@ def _uri2path(self, uri): return path def _path2uri(self, dirpath): - """ Convert directory path to uri """ + """Convert directory path to uri""" relpath = dirpath.replace(self.root_path, self.package_name) if relpath.startswith(os.path.sep): relpath = relpath[1:] return relpath.replace(os.path.sep, ".") def _parse_module(self, uri): - """ Parse module defined in *uri* """ + """Parse module defined in *uri*""" filename = self._uri2path(uri) if filename is None: # nothing that we could handle here. @@ -131,7 +130,7 @@ def _parse_module(self, uri): return functions, classes def _parse_lines(self, linesource, module): - """ Parse lines of text for functions and classes """ + """Parse lines of text for functions and classes""" functions = [] classes = [] for line in linesource: @@ -387,7 +386,7 @@ def test_specs(self, uri): return bad_specs def _survives_exclude(self, matchstr, match_type): - """ Returns True if *matchstr* does not match patterns + """Returns True if *matchstr* does not match patterns ``self.package_name`` removed from front of string if present @@ -429,7 +428,7 @@ def _survives_exclude(self, matchstr, match_type): return True def discover_modules(self): - """ Return module sequence discovered from ``self.package_name`` + """Return module sequence discovered from ``self.package_name`` Parameters diff --git a/tools/gitwash_dumper.py b/tools/gitwash_dumper.py index 36efd7f83e..2c08547bac 100755 --- a/tools/gitwash_dumper.py +++ b/tools/gitwash_dumper.py @@ -50,9 +50,7 @@ def cp_files(in_path, globs, out_path): def filename_search_replace(sr_pairs, filename, backup=False): - """ Search and replace for expressions in files - - """ + """Search and replace for expressions in files""" in_txt = open(filename, "rt").read(-1) out_txt = in_txt[:] for in_exp, out_exp in sr_pairs: @@ -94,7 +92,7 @@ def make_link_targets( url=None, ml_url=None, ): - """ Check and make link targets + """Check and make link targets If url is None or ml_url is None, check if there are links present for these in `known_link_fname`. If not, raise error. The check is: diff --git a/tools/run_examples.py b/tools/run_examples.py index 20382ef74d..bd77f1a0a4 100644 --- a/tools/run_examples.py +++ b/tools/run_examples.py @@ -4,9 +4,15 @@ if __name__ == "__main__": - print(dedent("""Nipype examples have been moved to niflow-nipype1-examples. + print( + dedent( + """Nipype examples have been moved to niflow-nipype1-examples. -Install with: pip install niflow-nipype1-examples""")) +Install with: pip install niflow-nipype1-examples""" + ) + ) if sys.argv[1:]: - print("Run this command with: niflow-nipype1-examples " + " ".join(sys.argv[1:])) + print( + "Run this command with: niflow-nipype1-examples " + " ".join(sys.argv[1:]) + ) sys.exit(1)