Skip to content

REL: 1.5.1 #3238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down Expand Up @@ -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.",
Expand All @@ -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",
Expand Down
18 changes: 17 additions & 1 deletion doc/changelog/1.X.X-changelog.rst
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/nipy/nipype/milestone/1.5.1?closed=1>`__)

* 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.

Expand Down
2 changes: 1 addition & 1 deletion doc/interfaces.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Interfaces and Workflows
:Release: |version|
:Date: |today|

Previous versions: `1.4.2 <http://nipype.readthedocs.io/en/1.4.2/>`_ `1.4.1 <http://nipype.readthedocs.io/en/1.4.1/>`_
Previous versions: `1.5.0 <http://nipype.readthedocs.io/en/1.5.0/>`_ `1.4.2 <http://nipype.readthedocs.io/en/1.4.2/>`_

Workflows
---------
Expand Down
2 changes: 1 addition & 1 deletion nipype/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# nipype version information
# Remove -dev for release
__version__ = "1.5.1-dev"
__version__ = "1.5.1"


def get_nipype_gitversion():
Expand Down
6 changes: 4 additions & 2 deletions nipype/interfaces/ants/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
1 change: 1 addition & 0 deletions nipype/interfaces/ants/segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down
6 changes: 3 additions & 3 deletions nipype/interfaces/ants/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion nipype/interfaces/freesurfer/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion nipype/interfaces/freesurfer/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
18 changes: 6 additions & 12 deletions nipype/interfaces/fsl/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
5 changes: 2 additions & 3 deletions nipype/interfaces/niftyreg/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion nipype/interfaces/spm/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
8 changes: 6 additions & 2 deletions nipype/pipeline/plugins/tests/test_multiproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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()

Expand Down
15 changes: 9 additions & 6 deletions nipype/utils/tests/test_filemanip.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down