From a09d0a9a2e277be27aa9bcd608d698d1c7baea53 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 14 Aug 2020 16:25:18 -0400 Subject: [PATCH 1/5] MNT: Set version 1.5.1 --- nipype/info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nipype/info.py b/nipype/info.py index 6c65d06d68..7ec5fef02e 100644 --- a/nipype/info.py +++ b/nipype/info.py @@ -5,7 +5,7 @@ # nipype version information # Remove -dev for release -__version__ = "1.5.1-dev" +__version__ = "1.5.1" def get_nipype_gitversion(): From 83358d7f17aac07cb90d0330f11ea2322e2974d8 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 14 Aug 2020 17:15:15 -0400 Subject: [PATCH 2/5] STY: Black --- nipype/interfaces/ants/registration.py | 6 ++++-- nipype/interfaces/ants/segmentation.py | 1 + nipype/interfaces/ants/utils.py | 6 +++--- nipype/interfaces/freesurfer/base.py | 2 +- nipype/interfaces/freesurfer/preprocess.py | 5 ++++- nipype/interfaces/fsl/preprocess.py | 18 ++++++------------ nipype/interfaces/niftyreg/base.py | 5 ++--- nipype/interfaces/spm/preprocess.py | 2 +- .../tests/test_legacymultiproc_nondaemon.py | 8 ++++++-- .../pipeline/plugins/tests/test_multiproc.py | 8 ++++++-- nipype/utils/tests/test_filemanip.py | 15 +++++++++------ 11 files changed, 43 insertions(+), 33 deletions(-) diff --git a/nipype/interfaces/ants/registration.py b/nipype/interfaces/ants/registration.py index b9b6700dcd..47b8d53cfc 100644 --- a/nipype/interfaces/ants/registration.py +++ b/nipype/interfaces/ants/registration.py @@ -592,7 +592,8 @@ class RegistrationOutputSpec(TraitedSpec): File(exists=True), desc="List of output transforms for forward registration" ) reverse_forward_transforms = traits.List( - File(exists=True), desc="List of output transforms for forward registration reversed for antsApplyTransform" + File(exists=True), + desc="List of output transforms for forward registration reversed for antsApplyTransform", ) reverse_transforms = traits.List( File(exists=True), desc="List of output transforms for reverse registration" @@ -601,7 +602,8 @@ class RegistrationOutputSpec(TraitedSpec): traits.Bool(), desc="List of flags corresponding to the forward transforms" ) reverse_forward_invert_flags = traits.List( - traits.Bool(), desc="List of flags corresponding to the forward transforms reversed for antsApplyTransform" + traits.Bool(), + desc="List of flags corresponding to the forward transforms reversed for antsApplyTransform", ) reverse_invert_flags = traits.List( traits.Bool(), desc="List of flags corresponding to the reverse transforms" diff --git a/nipype/interfaces/ants/segmentation.py b/nipype/interfaces/ants/segmentation.py index 387fd229a1..555cdd1777 100644 --- a/nipype/interfaces/ants/segmentation.py +++ b/nipype/interfaces/ants/segmentation.py @@ -543,6 +543,7 @@ def _list_outputs(self): outputs["bias_image"] = os.path.abspath(self._out_bias_file) return outputs + class CorticalThicknessInputSpec(ANTSCommandInputSpec): dimension = traits.Enum( 3, 2, argstr="-d %d", usedefault=True, desc="image dimension (2 or 3)" diff --git a/nipype/interfaces/ants/utils.py b/nipype/interfaces/ants/utils.py index 6ca6af2d98..a6fdc5cf00 100644 --- a/nipype/interfaces/ants/utils.py +++ b/nipype/interfaces/ants/utils.py @@ -138,18 +138,18 @@ class ImageMath(ANTSCommand, CopyHeaderInterface): def __init__(self, **inputs): super(ImageMath, self).__init__(**inputs) - if self.inputs.operation in ("PadImage", ): + if self.inputs.operation in ("PadImage",): self.inputs.copy_header = False self.inputs.on_trait_change(self._operation_update, "operation") self.inputs.on_trait_change(self._copyheader_update, "copy_header") def _operation_update(self): - if self.inputs.operation in ("PadImage", ): + if self.inputs.operation in ("PadImage",): self.inputs.copy_header = False def _copyheader_update(self): - if self.inputs.copy_header and self.inputs.operation in ("PadImage", ): + if self.inputs.copy_header and self.inputs.operation in ("PadImage",): warn("copy_header cannot be updated to True with PadImage as operation.") self.inputs.copy_header = False diff --git a/nipype/interfaces/freesurfer/base.py b/nipype/interfaces/freesurfer/base.py index e9fe62ee50..1108cbf6bc 100644 --- a/nipype/interfaces/freesurfer/base.py +++ b/nipype/interfaces/freesurfer/base.py @@ -76,7 +76,7 @@ def looseversion(cls): vstr = "6.0.0-dev" + githash elif vinfo[5][0] == "v": vstr = vinfo[5][1:] - elif len([1 for val in vinfo[3] if val == '.']) == 2: + elif len([1 for val in vinfo[3] if val == "."]) == 2: "version string: freesurfer-linux-centos7_x86_64-7.1.0-20200511-813297b" vstr = vinfo[3] else: diff --git a/nipype/interfaces/freesurfer/preprocess.py b/nipype/interfaces/freesurfer/preprocess.py index 92fbe7d7f7..91eba956b5 100644 --- a/nipype/interfaces/freesurfer/preprocess.py +++ b/nipype/interfaces/freesurfer/preprocess.py @@ -727,7 +727,10 @@ def cmdline(self): outdir = self._get_outdir() cmd = [] if not os.path.exists(outdir): - cmdstr = "%s -c \"import os; os.makedirs('%s')\"" % (op.basename(sys.executable), outdir) + cmdstr = "%s -c \"import os; os.makedirs('%s')\"" % ( + op.basename(sys.executable), + outdir, + ) cmd.extend([cmdstr]) infofile = os.path.join(outdir, "shortinfo.txt") if not os.path.exists(infofile): diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index feebf4e742..f2fbe8c079 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -174,9 +174,9 @@ def _list_outputs(self): outputs = self.output_spec().get() outputs["out_file"] = self._gen_outfilename() - basename = os.path.basename(outputs['out_file']) - cwd = os.path.dirname(outputs['out_file']) - kwargs = {'basename': basename, 'cwd': cwd} + basename = os.path.basename(outputs["out_file"]) + cwd = os.path.dirname(outputs["out_file"]) + kwargs = {"basename": basename, "cwd": cwd} if (isdefined(self.inputs.mesh) and self.inputs.mesh) or ( isdefined(self.inputs.surfaces) and self.inputs.surfaces @@ -189,9 +189,7 @@ def _list_outputs(self): ): outputs["mask_file"] = self._gen_fname(suffix="_mask", **kwargs) if isdefined(self.inputs.outline) and self.inputs.outline: - outputs["outline_file"] = self._gen_fname( - suffix="_overlay", **kwargs - ) + outputs["outline_file"] = self._gen_fname(suffix="_overlay", **kwargs) if isdefined(self.inputs.surfaces) and self.inputs.surfaces: outputs["inskull_mask_file"] = self._gen_fname( suffix="_inskull_mask", **kwargs @@ -211,13 +209,9 @@ def _list_outputs(self): outputs["outskin_mesh_file"] = self._gen_fname( suffix="_outskin_mesh", **kwargs ) - outputs["skull_mask_file"] = self._gen_fname( - suffix="_skull_mask", **kwargs - ) + outputs["skull_mask_file"] = self._gen_fname(suffix="_skull_mask", **kwargs) if isdefined(self.inputs.skull) and self.inputs.skull: - outputs["skull_file"] = self._gen_fname( - suffix="_skull", **kwargs - ) + outputs["skull_file"] = self._gen_fname(suffix="_skull", **kwargs) if isdefined(self.inputs.no_output) and self.inputs.no_output: outputs["out_file"] = Undefined return outputs diff --git a/nipype/interfaces/niftyreg/base.py b/nipype/interfaces/niftyreg/base.py index 88e441d52a..375a3ada29 100644 --- a/nipype/interfaces/niftyreg/base.py +++ b/nipype/interfaces/niftyreg/base.py @@ -19,8 +19,7 @@ import os from ... import logging -from ..base import (CommandLine, CommandLineInputSpec, traits, Undefined, - PackageInfo) +from ..base import CommandLine, CommandLineInputSpec, traits, Undefined, PackageInfo from ...utils.filemanip import split_filename iflogger = logging.getLogger("nipype.interface") @@ -31,7 +30,7 @@ def get_custom_path(command, env_dir="NIFTYREGDIR"): class Info(PackageInfo): - version_cmd = get_custom_path('reg_aladin') + ' --version' + version_cmd = get_custom_path("reg_aladin") + " --version" @staticmethod def parse_version(raw_info): diff --git a/nipype/interfaces/spm/preprocess.py b/nipype/interfaces/spm/preprocess.py index 4f7df04c92..17dc03ff5a 100644 --- a/nipype/interfaces/spm/preprocess.py +++ b/nipype/interfaces/spm/preprocess.py @@ -1884,7 +1884,7 @@ class MultiChannelNewSegmentInputSpec(SPMCommandInputSpec): - FWHM of Gaussian smoothness of bias - which maps to save (Field, Corrected) - a tuple of two boolean values""", field="channel", - ) + ), ), desc="""A list of tuples (one per each channel) with the following fields: - a list of channel files (only 1rst channel files will be segmented) diff --git a/nipype/pipeline/plugins/tests/test_legacymultiproc_nondaemon.py b/nipype/pipeline/plugins/tests/test_legacymultiproc_nondaemon.py index 2e814bbf3e..5f33b025b2 100644 --- a/nipype/pipeline/plugins/tests/test_legacymultiproc_nondaemon.py +++ b/nipype/pipeline/plugins/tests/test_legacymultiproc_nondaemon.py @@ -134,7 +134,9 @@ def run_multiproc_nondaemon_with_flag(nondaemon_flag): return result -@pytest.mark.skipif(sys.version_info >= (3, 8), reason="multiprocessing issues in Python 3.8") +@pytest.mark.skipif( + sys.version_info >= (3, 8), reason="multiprocessing issues in Python 3.8" +) def test_run_multiproc_nondaemon_false(): """ This is the entry point for the test. Two times a pipe of several @@ -153,7 +155,9 @@ def test_run_multiproc_nondaemon_false(): assert shouldHaveFailed -@pytest.mark.skipif(sys.version_info >= (3, 8), reason="multiprocessing issues in Python 3.8") +@pytest.mark.skipif( + sys.version_info >= (3, 8), reason="multiprocessing issues in Python 3.8" +) def test_run_multiproc_nondaemon_true(): # with nondaemon_flag = True, the execution should succeed result = run_multiproc_nondaemon_with_flag(True) diff --git a/nipype/pipeline/plugins/tests/test_multiproc.py b/nipype/pipeline/plugins/tests/test_multiproc.py index 9916785e3d..142d108ebc 100644 --- a/nipype/pipeline/plugins/tests/test_multiproc.py +++ b/nipype/pipeline/plugins/tests/test_multiproc.py @@ -34,7 +34,9 @@ def _list_outputs(self): return outputs -@pytest.mark.skipif(sys.version_info >= (3, 8), reason="multiprocessing issues in Python 3.8") +@pytest.mark.skipif( + sys.version_info >= (3, 8), reason="multiprocessing issues in Python 3.8" +) def test_run_multiproc(tmpdir): tmpdir.chdir() @@ -116,7 +118,9 @@ def test_no_more_threads_than_specified(tmpdir): pipe.run(plugin="MultiProc", plugin_args={"n_procs": max_threads}) -@pytest.mark.skipif(sys.version_info >= (3, 8), reason="multiprocessing issues in Python 3.8") +@pytest.mark.skipif( + sys.version_info >= (3, 8), reason="multiprocessing issues in Python 3.8" +) def test_hold_job_until_procs_available(tmpdir): tmpdir.chdir() diff --git a/nipype/utils/tests/test_filemanip.py b/nipype/utils/tests/test_filemanip.py index fed2462548..e8da256261 100644 --- a/nipype/utils/tests/test_filemanip.py +++ b/nipype/utils/tests/test_filemanip.py @@ -655,12 +655,15 @@ def test_pickle(tmp_path, save_versioning): assert outobj == testobj -@pytest.mark.parametrize("items,expected", [ - ('', ' \n\n'), - ('A string', ' A string\n\n'), - (['A list', 'Of strings'], ' A list\n Of strings\n\n'), - (None, TypeError), -]) +@pytest.mark.parametrize( + "items,expected", + [ + ("", " \n\n"), + ("A string", " A string\n\n"), + (["A list", "Of strings"], " A list\n Of strings\n\n"), + (None, TypeError), + ], +) def test_write_rst_list(tmp_path, items, expected): if items is not None: assert write_rst_list(items) == expected From e1f5c0263ed775a51deb01811fa79a1ac57c51af Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Sat, 15 Aug 2020 10:20:50 -0400 Subject: [PATCH 3/5] DOC: Update previous versions --- doc/interfaces.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/interfaces.rst b/doc/interfaces.rst index b612555a7c..85dbb9f779 100644 --- a/doc/interfaces.rst +++ b/doc/interfaces.rst @@ -8,7 +8,7 @@ Interfaces and Workflows :Release: |version| :Date: |today| -Previous versions: `1.4.2 `_ `1.4.1 `_ +Previous versions: `1.5.0 `_ `1.4.2 `_ Workflows --------- From c98bfbfc65ce2f846e52ae65ee1b261ee3afb68b Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Sun, 16 Aug 2020 13:34:28 -0400 Subject: [PATCH 4/5] DOC: Update changelog --- doc/changelog/1.X.X-changelog.rst | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/doc/changelog/1.X.X-changelog.rst b/doc/changelog/1.X.X-changelog.rst index e10949cf08..4855404401 100644 --- a/doc/changelog/1.X.X-changelog.rst +++ b/doc/changelog/1.X.X-changelog.rst @@ -1,5 +1,21 @@ +1.5.1 (August 16, 2020) +======================= + +Bug-fix release in the 1.5.x series. + +This release includes small updates to ANTs utilities that lie somewhere +between bug fixes and enhancements. + +(`Full changelog `__) + + * FIX: Warn for min/max_ver traits when tool version can't be parsed (https://github.com/nipy/nipype/pull/3241) + * FIX: Serialize all interface arguments when exporting workflows (https://github.com/nipy/nipype/pull/3240) + * FIX: Permit identity transforms in list of transforms given to ants.ApplyTransforms (https://github.com/nipy/nipype/pull/3237) + * FIX: ANTs' utilities revision - bug fixes and add more operations to ``ants.ImageMath`` (https://github.com/nipy/nipype/pull/3236) + * DOC: Skip BIDSDataGrabber doctest if pybids is missing (https://github.com/nipy/nipype/pull/3224) + 1.5.0 (June 03, 2020) -========================= +===================== New feature release in the 1.5.x series. From a8367b03a6fa4f71c99fd2a056a27fc311e07922 Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Sun, 16 Aug 2020 13:34:51 -0400 Subject: [PATCH 5/5] DOC: Update Zenodo --- .zenodo.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.zenodo.json b/.zenodo.json index 2ee43c9904..7324bd942c 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -115,16 +115,16 @@ "name": "Hamalainen, Carlo", "orcid": "0000-0001-7655-3830" }, - { - "affiliation": "Stanford University", - "name": "\u0106iri\u0107 , Rastko", - "orcid": "0000-0001-6347-7939" - }, { "affiliation": "Institute for Biomedical Engineering, ETH and University of Zurich", "name": "Christian, Horea", "orcid": "0000-0001-7037-2449" }, + { + "affiliation": "Stanford University", + "name": "\u0106iri\u0107 , Rastko", + "orcid": "0000-0001-6347-7939" + }, { "name": "Dubois, Mathieu" }, @@ -225,6 +225,11 @@ { "name": "Millman, Jarrod" }, + { + "affiliation": "University College London", + "name": "Mancini, Matteo", + "orcid": "0000-0001-7194-4568" + }, { "affiliation": "National Institute of Mental Health", "name": "Nielson, Dylan M.", @@ -241,11 +246,6 @@ { "name": "Mordom, David" }, - { - "affiliation": "University College London", - "name": "Mancini, Matteo", - "orcid": "0000-0001-7194-4568" - }, { "affiliation": "ARAMIS LAB, Brain and Spine Institute (ICM), Paris, France.", "name": "Guillon, Je\u0301re\u0301my",