Skip to content

Commit 609c505

Browse files
committed
Merge branch 'ref/interface-base' of github.com:oesteban/nipype into ref/interface-base
2 parents 15cd86f + 79c22ee commit 609c505

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+164
-220
lines changed

.zenodo.json

Lines changed: 131 additions & 106 deletions
Large diffs are not rendered by default.

CHANGES

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Upcoming release
1+
Upcoming release (0.14.1)
22
================
33

44

doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
# The short X.Y version.
8383
version = nipype.__version__
8484
# The full version, including alpha/beta/rc tags.
85-
release = "0.14.0-rc1"
85+
release = "0.14.0"
8686

8787
# The language for content autogenerated by Sphinx. Refer to documentation
8888
# for a list of supported languages.

nipype/info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# full release. '.dev' as a version_extra string means this is a development
1111
# version
1212
# Remove -dev for release
13-
__version__ = '0.14.0-rc1'
13+
__version__ = '0.14.1-dev'
1414

1515

1616
def get_nipype_gitversion():

nipype/interfaces/ants/tests/test_auto_ANTS.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ def test_ANTS_inputs():
2626
),
2727
metric=dict(mandatory=True,
2828
),
29-
metric_weight=dict(requires=['metric'],
29+
metric_weight=dict(mandatory=True,
30+
requires=['metric'],
31+
usedefault=True,
3032
),
3133
mi_option=dict(argstr='--MI-option %s',
3234
sep='x',
@@ -49,7 +51,8 @@ def test_ANTS_inputs():
4951
mandatory=True,
5052
usedefault=True,
5153
),
52-
radius=dict(requires=['metric'],
54+
radius=dict(mandatory=True,
55+
requires=['metric'],
5356
),
5457
regularization=dict(argstr='%s',
5558
),

nipype/interfaces/base/specs.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -252,30 +252,30 @@ def get_hashval(self, hash_method=None):
252252
253253
Returns
254254
-------
255-
dict_withhash : dict
255+
list_withhash : dict
256256
Copy of our dictionary with the new file hashes included
257257
with each file.
258258
hashvalue : str
259259
The md5 hash value of the traited spec
260260
261261
"""
262262

263-
dict_withhash = []
264-
dict_nofilename = []
263+
list_withhash = []
264+
list_nofilename = []
265265
for name, val in sorted(self.get().items()):
266266
if not isdefined(val) or self.has_metadata(name, "nohash", True):
267267
# skip undefined traits and traits with nohash=True
268268
continue
269269

270270
hash_files = (not self.has_metadata(name, "hash_files", False) and not
271271
self.has_metadata(name, "name_source"))
272-
dict_nofilename.append((name,
272+
list_nofilename.append((name,
273273
self._get_sorteddict(val, hash_method=hash_method,
274274
hash_files=hash_files)))
275-
dict_withhash.append((name,
275+
list_withhash.append((name,
276276
self._get_sorteddict(val, True, hash_method=hash_method,
277277
hash_files=hash_files)))
278-
return dict_withhash, md5(to_str(dict_nofilename).encode()).hexdigest()
278+
return list_withhash, md5(to_str(list_nofilename).encode()).hexdigest()
279279

280280
def _get_sorteddict(self, objekt, dictwithhash=False, hash_method=None,
281281
hash_files=True):

nipype/interfaces/base/support.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ class Bunch(object):
4949
>>> inputs
5050
Bunch(fwhm=6.0, infile='subj.nii', register_to_mean=False)
5151
52-
5352
Notes
5453
-----
5554
The Bunch pattern came from the Python Cookbook:

nipype/interfaces/fsl/model.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2173,7 +2173,7 @@ def _list_outputs(self):
21732173

21742174

21752175
def load_template(name):
2176-
"""Load a template from the script_templates directory
2176+
"""Load a template from the model_templates directory
21772177
21782178
Parameters
21792179
----------
@@ -2186,8 +2186,8 @@ def load_template(name):
21862186
21872187
"""
21882188
from pkg_resources import resource_filename as pkgrf
2189-
full_fname = pkgrf('nipype',
2190-
os.path.join('script_templates', name))
2189+
full_fname = pkgrf(
2190+
'nipype', os.path.join('interfaces', 'fsl', 'model_templates', name))
21912191
with open(full_fname) as template_file:
21922192
template = Template(template_file.read())
21932193

nipype/interfaces/niftyfit/tests/test_asl.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,11 @@
44

55
import pytest
66

7-
from ....utils.filemanip import which
87
from ....testing import example_data
98
from ...niftyreg import get_custom_path
109

1110
from ..asl import FitAsl
12-
13-
14-
def no_nifty_tool(cmd=None):
15-
return which(cmd) is None
11+
from ...niftyreg.tests.test_regutils import no_nifty_tool
1612

1713

1814
@pytest.mark.skipif(no_nifty_tool(cmd='fit_asl'),

nipype/interfaces/niftyfit/tests/test_dwi.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,11 @@
33

44
import pytest
55

6-
from ....utils.filemanip import which
76
from ....testing import example_data
87
from ...niftyreg import get_custom_path
98

109
from ..dwi import FitDwi, DwiTool
11-
12-
13-
def no_nifty_tool(cmd=None):
14-
return which(cmd) is None
10+
from ...niftyreg.tests.test_regutils import no_nifty_tool
1511

1612

1713
@pytest.mark.skipif(no_nifty_tool(cmd='fit_dwi'),

nipype/interfaces/niftyfit/tests/test_qt1.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,12 @@
44

55
import pytest
66

7-
from ....utils.filemanip import which
87
from ....testing import example_data
98
from ...niftyreg import get_custom_path
10-
9+
from ...niftyreg.tests.test_regutils import no_nifty_tool
1110
from ..qt1 import FitQt1
1211

1312

14-
def no_nifty_tool(cmd=None):
15-
return which(cmd) is None
16-
17-
1813
@pytest.mark.skipif(no_nifty_tool(cmd='fit_qt1'),
1914
reason="niftyfit is not installed")
2015
def test_fit_qt1():

nipype/interfaces/niftyreg/tests/test_reg.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,9 @@
44

55
import pytest
66

7-
from ....utils.filemanip import which
87
from ....testing import example_data
98
from .. import (get_custom_path, RegAladin, RegF3D)
10-
11-
12-
def no_nifty_tool(cmd=None):
13-
return which(cmd) is None
9+
from .test_regutils import no_nifty_tool
1410

1511

1612
@pytest.mark.skipif(

nipype/interfaces/niftyseg/tests/test_em_interfaces.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,12 @@
33

44
import pytest
55

6-
from ....utils.filemanip import which
76
from ....testing import example_data
87
from ...niftyreg import get_custom_path
8+
from ...niftyreg.tests.test_regutils import no_nifty_tool
99
from .. import EM
1010

1111

12-
def no_nifty_tool(cmd=None):
13-
return which(cmd) is None
14-
15-
1612
@pytest.mark.skipif(no_nifty_tool(cmd='seg_EM'),
1713
reason="niftyseg is not installed")
1814
def test_seg_em():

nipype/interfaces/niftyseg/tests/test_label_fusion.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,12 @@
33

44
import pytest
55

6-
from ....utils.filemanip import which
76
from ....testing import example_data
87
from ...niftyreg import get_custom_path
8+
from ...niftyreg.tests.test_regutils import no_nifty_tool
99
from .. import LabelFusion, CalcTopNCC
1010

1111

12-
def no_nifty_tool(cmd=None):
13-
return which(cmd) is None
14-
15-
1612
@pytest.mark.skipif(no_nifty_tool(cmd='seg_LabFusion'),
1713
reason="niftyseg is not installed")
1814
def test_seg_lab_fusion():

nipype/interfaces/niftyseg/tests/test_lesions.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,12 @@
33

44
import pytest
55

6-
from ....utils.filemanip import which
76
from ....testing import example_data
87
from ...niftyreg import get_custom_path
8+
from ...niftyreg.tests.test_regutils import no_nifty_tool
99
from .. import FillLesions
1010

1111

12-
def no_nifty_tool(cmd=None):
13-
return which(cmd) is None
14-
15-
1612
@pytest.mark.skipif(no_nifty_tool(cmd='seg_FillLesions'),
1713
reason="niftyseg is not installed")
1814
def test_seg_filllesions():

nipype/interfaces/niftyseg/tests/test_maths.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,14 @@
33

44
import pytest
55

6-
from ....utils.filemanip import which
76
from ....testing import example_data
87
from ...niftyreg import get_custom_path
8+
from ...niftyreg.tests.test_regutils import no_nifty_tool
99
from .. import (UnaryMaths, BinaryMaths,
1010
BinaryMathsInteger, TupleMaths,
1111
Merge)
1212

1313

14-
def no_nifty_tool(cmd=None):
15-
return which(cmd) is None
16-
17-
1814
@pytest.mark.skipif(no_nifty_tool(cmd='seg_maths'),
1915
reason="niftyseg is not installed")
2016
def test_unary_maths():

nipype/interfaces/niftyseg/tests/test_patchmatch.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,12 @@
33

44
import pytest
55

6-
from ....utils.filemanip import which
76
from ....testing import example_data
87
from ...niftyreg import get_custom_path
8+
from ...niftyreg.tests.test_regutils import no_nifty_tool
99
from .. import PatchMatch
1010

1111

12-
def no_nifty_tool(cmd=None):
13-
return which(cmd) is None
14-
15-
1612
@pytest.mark.skipif(no_nifty_tool(cmd='seg_PatchMatch'),
1713
reason="niftyseg is not installed")
1814
def test_seg_patchmatch():

nipype/interfaces/niftyseg/tests/test_stats.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,12 @@
33

44
import pytest
55

6-
from ....utils.filemanip import which
76
from ....testing import example_data
87
from ...niftyreg import get_custom_path
8+
from ...niftyreg.tests.test_regutils import no_nifty_tool
99
from .. import UnaryStats, BinaryStats
1010

1111

12-
def no_nifty_tool(cmd=None):
13-
return which(cmd) is None
14-
15-
1612
@pytest.mark.skipif(no_nifty_tool(cmd='seg_stats'),
1713
reason="niftyseg is not installed")
1814
def test_unary_stats():

nipype/interfaces/setup.py

Lines changed: 0 additions & 42 deletions
This file was deleted.

nipype/pipeline/plugins/tests/test_callback.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def test_callback_multiproc_normal(tmpdir):
7272
tmpdir.chdir()
7373

7474
so = Status()
75-
wf = pe.Workflow(name='test')
75+
wf = pe.Workflow(name='test', base_dir=tmpdir.strpath)
7676
f_node = pe.Node(niu.Function(function=func, input_names=[],
7777
output_names=[]),
7878
name='f_node')
@@ -90,7 +90,7 @@ def test_callback_multiproc_exception(tmpdir):
9090
tmpdir.chdir()
9191

9292
so = Status()
93-
wf = pe.Workflow(name='test')
93+
wf = pe.Workflow(name='test', base_dir=tmpdir.strpath)
9494
f_node = pe.Node(niu.Function(function=bad_func, input_names=[],
9595
output_names=[]),
9696
name='f_node')

nipype/utils/filemanip.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ def which(cmd, env=None, pathext=None):
684684
"""
685685

686686
if pathext is None:
687-
pathext = os.environ.get("PATHEXT", "").split(os.pathsep)
687+
pathext = os.getenv('PATHEXT', '').split(os.pathsep)
688688
pathext.insert(0, '')
689689

690690
path = os.getenv("PATH", os.defpath)
@@ -751,10 +751,10 @@ def canonicalize_env(env):
751751
return env
752752

753753
out_env = {}
754-
for key, val in env:
754+
for key, val in env.items():
755755
if not isinstance(key, bytes):
756756
key = key.encode('utf-8')
757757
if not isinstance(val, bytes):
758-
val = key.encode('utf-8')
758+
val = val.encode('utf-8')
759759
out_env[key] = val
760760
return out_env

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def main():
106106
pjoin('workflows', 'data', '*'),
107107
pjoin('pipeline', 'engine', 'report_template.html'),
108108
pjoin('external', 'd3.js'),
109-
pjoin('script_templates', '*'),
109+
pjoin('interfaces', 'fsl', 'model_templates', '*'),
110110
pjoin('interfaces', 'tests', 'realign_json.json'),
111111
pjoin('interfaces', 'tests', 'use_resources'),
112112
'pytest.ini',

0 commit comments

Comments
 (0)