Skip to content

Commit d663e2f

Browse files
committed
test passing locally
1 parent d9c7f3d commit d663e2f

Some content is hidden

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

50 files changed

+70
-62
lines changed

nipype/interfaces/base/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,15 @@
1717
from .specs import (
1818
BaseTraitedSpec, TraitedSpec, DynamicTraitedSpec,
1919
BaseInterfaceInputSpec, CommandLineInputSpec,
20+
StdOutCommandLineInputSpec
2021
)
2122

2223
from .traits_extension import (
2324
traits, Undefined, TraitDictObject, TraitListObject, TraitError, isdefined,
2425
File, Directory, Str, DictStrStr, has_metadata, ImageFile,
2526
MultiPath, OutputMultiPath, InputMultiPath)
2627

27-
from .support import Bunch, InterfaceResult, load_template
28+
from .support import (
29+
Bunch, InterfaceResult, load_template,
30+
NipypeInterfaceError
31+
)

nipype/interfaces/base/core.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ def run(self, **inputs):
440440
results : an InterfaceResult object containing a copy of the instance
441441
that was executed, provenance information and, if successful, results
442442
"""
443-
from ..utils.profiler import ResourceMonitor
443+
from ...utils.profiler import ResourceMonitor
444444

445445
enable_rm = config.resource_monitor and self.resource_monitor
446446
force_raise = not getattr(self.inputs, 'ignore_exception', False)
@@ -624,6 +624,7 @@ class SimpleInterface(BaseInterface):
624624
625625
.. testsetup::
626626
627+
>>> from .specs import TraitedSpec
627628
>>> tmp = getfixture('tmpdir')
628629
>>> old = tmp.chdir() # changing to a temporary directory
629630

nipype/interfaces/base/traits_extension.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ class OutputMultiPath(MultiPath):
395395
396396
XXX This needs to be vetted by somebody who understands traits
397397
398-
>>> from nipype.interfaces.base import OutputMultiPath
398+
>>> from nipype.interfaces.base import OutputMultiPath, TraitedSpec
399399
>>> class A(TraitedSpec):
400400
... foo = OutputMultiPath(File(exists=False))
401401
>>> a = A()
@@ -440,7 +440,7 @@ class InputMultiPath(MultiPath):
440440
441441
XXX This needs to be vetted by somebody who understands traits
442442
443-
>>> from nipype.interfaces.base import InputMultiPath
443+
>>> from nipype.interfaces.base import InputMultiPath, TraitedSpec
444444
>>> class A(TraitedSpec):
445445
... foo = InputMultiPath(File(exists=False))
446446
>>> a = A()

nipype/interfaces/brainsuite/brainsuite.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import re as regex
66

77
from ..base import TraitedSpec, CommandLineInputSpec, CommandLine, File, traits, isdefined
8-
from ..traits_extension import str
8+
99

1010
"""This script provides interfaces for BrainSuite command line tools.
1111
Please see brainsuite.org for more information.
@@ -902,7 +902,7 @@ class SVRegInputSpec(CommandLineInputSpec):
902902
'Cortical Surface Extraction Sequence'
903903
)
904904
dataSinkDelay = traits.List(
905-
str, argstr='%s',
905+
traits.Str, argstr='%s',
906906
desc='Connect datasink out_file to dataSinkDelay to delay execution of SVReg '
907907
'until dataSink has finished sinking CSE outputs.'
908908
'For use with parallel processing workflows including Brainsuites Cortical '
@@ -1087,7 +1087,7 @@ class BDPInputSpec(CommandLineInputSpec):
10871087
'bvec and .bval files can be used instead (see diffusionGradientFile and bValueFile). '
10881088
)
10891089
BVecBValPair = traits.List(
1090-
str, minlen=2, maxlen=2, mandatory=True, position=-1, xor=['bMatrixFile'],
1090+
traits.Str, minlen=2, maxlen=2, mandatory=True, position=-1, xor=['bMatrixFile'],
10911091
argstr='--bvec %s --bval %s',
10921092
desc='Must input a list containing first the BVector file, then the BValue file (both must be absolute paths)\n'
10931093
'Example: bdp.inputs.BVecBValPair = [\'/directory/subdir/prefix.dwi.bvec\', \'/directory/subdir/prefix.dwi.bval\'] '
@@ -1100,7 +1100,7 @@ class BDPInputSpec(CommandLineInputSpec):
11001100
'usually has an extension of .bvec '
11011101
)
11021102
dataSinkDelay = traits.List(
1103-
str, argstr='%s',
1103+
traits.Str, argstr='%s',
11041104
desc='For use in parallel processing workflows including Brainsuite Cortical '
11051105
'Surface Extraction sequence. Connect datasink out_file to dataSinkDelay '
11061106
'to delay execution of BDP until dataSink has finished sinking outputs. '

nipype/interfaces/dcmstack.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@
1919
import nibabel as nb
2020
import imghdr
2121

22-
from .base import (TraitedSpec, DynamicTraitedSpec,
23-
InputMultiPath, File, Directory,
24-
traits, BaseInterface)
25-
from .traits_extension import isdefined, Undefined
22+
from .base import (
23+
TraitedSpec, DynamicTraitedSpec,
24+
InputMultiPath, File, Directory,
25+
traits, BaseInterface,
26+
isdefined, Undefined
27+
)
2628
from ..utils import NUMPY_MMAP
2729

2830

nipype/interfaces/fsl/fix.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,24 @@
6464
OutputMultiPath,
6565
BaseInterface,
6666
BaseInterfaceInputSpec,
67-
traits
67+
traits,
68+
Directory,
69+
File,
70+
isdefined
6871
)
69-
from ..traits_extension import Directory, File, isdefined
7072
import os
7173

7274

7375
class TrainingSetCreatorInputSpec(BaseInterfaceInputSpec):
7476
mel_icas_in = InputMultiPath(Directory(exists=True), copyfile=False,
75-
desc='Melodic output directories',
76-
argstr='%s', position=-1)
77+
desc='Melodic output directories',
78+
argstr='%s', position=-1)
79+
7780

7881
class TrainingSetCreatorOutputSpec(TraitedSpec):
7982
mel_icas_out = OutputMultiPath(Directory(exists=True), copyfile=False,
80-
desc='Hand labels for noise vs signal',
81-
argstr='%s', position=-1)
83+
desc='Hand labels for noise vs signal',
84+
argstr='%s', position=-1)
8285

8386

8487
class TrainingSetCreator(BaseInterface):

nipype/interfaces/fsl/model.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2185,9 +2185,10 @@ def load_template(name):
21852185
template : string.Template
21862186
21872187
"""
2188-
full_fname = os.path.join(os.path.dirname(__file__),
2189-
'script_templates', name)
2190-
template_file = open(full_fname)
2191-
template = Template(template_file.read())
2192-
template_file.close()
2188+
from pkg_resources import resource_filename as pkgrf
2189+
full_fname = pkgrf('nipype',
2190+
os.path.join('script_templates', name))
2191+
with open(full_fname) as template_file:
2192+
template = Template(template_file.read())
2193+
21932194
return template

nipype/interfaces/mrtrix/tracking.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
import os.path as op
1616

1717
from ...utils.filemanip import split_filename
18-
from ..base import CommandLineInputSpec, CommandLine, traits, TraitedSpec, File
19-
from ..traits_extension import isdefined
18+
from ..base import (
19+
CommandLineInputSpec, CommandLine, traits, TraitedSpec, File,
20+
isdefined
21+
)
2022

2123

2224
class FilterTracksInputSpec(CommandLineInputSpec):

nipype/interfaces/mrtrix3/base.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
from __future__ import print_function, division, unicode_literals, absolute_import
1515

1616
from ... import logging
17-
from ..traits_extension import isdefined
18-
from ..base import (CommandLineInputSpec, CommandLine, traits, File)
17+
from ..base import (CommandLineInputSpec, CommandLine, traits, File, isdefined)
1918
iflogger = logging.getLogger('interface')
2019

2120

nipype/interfaces/mrtrix3/connectivity.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
import os
1717
import os.path as op
1818

19-
from ..traits_extension import isdefined
20-
from ..base import (CommandLineInputSpec, traits, TraitedSpec, File)
19+
from ..base import (CommandLineInputSpec, traits, TraitedSpec, File, isdefined)
2120
from .base import MRTrix3Base
2221

2322

0 commit comments

Comments
 (0)