Skip to content

Commit d9c7f3d

Browse files
committed
fix final errors and wrong imports
1 parent 82411ae commit d9c7f3d

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

nipype/interfaces/base/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,19 @@
99
1010
"""
1111
from .core import (
12-
BaseInterface, SimpleInterface, CommandLine, StdOutCommandLine,
12+
Interface, BaseInterface, SimpleInterface,
13+
CommandLine, StdOutCommandLine,
1314
MpiCommandLine, SEMLikeCommandLine, PackageInfo
1415
)
1516

1617
from .specs import (
17-
BaseTraitedSpec, BaseInterfaceInputSpec, CommandLineInputSpec,
18+
BaseTraitedSpec, TraitedSpec, DynamicTraitedSpec,
19+
BaseInterfaceInputSpec, CommandLineInputSpec,
1820
)
1921

2022
from .traits_extension import (
2123
traits, Undefined, TraitDictObject, TraitListObject, TraitError, isdefined,
2224
File, Directory, Str, DictStrStr, has_metadata, ImageFile,
2325
MultiPath, OutputMultiPath, InputMultiPath)
2426

25-
from .support import load_template
27+
from .support import Bunch, InterfaceResult, load_template

nipype/interfaces/base/specs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ class TraitedSpec(BaseTraitedSpec):
316316
317317
This is used in 90% of the cases.
318318
"""
319+
_ = traits.Disallow
319320

320321

321322
class BaseInterfaceInputSpec(TraitedSpec):
@@ -354,7 +355,6 @@ def __deepcopy__(self, memo):
354355
dup = self.clone_traits(memo=memo)
355356
dup.trait_set(**dup_dict)
356357
return dup
357-
_ = traits.Disallow
358358

359359

360360
class CommandLineInputSpec(BaseInterfaceInputSpec):

nipype/pipeline/engine/nodes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@
4242
copyfiles, fnames_presuffix, loadpkl,
4343
split_filename, load_json, savepkl,
4444
write_rst_header, write_rst_dict,
45-
write_rst_list, to_str)
45+
write_rst_list, to_str, md5)
4646
from ...interfaces.base import (traits, InputMultiPath, CommandLine,
4747
Undefined, TraitedSpec, DynamicTraitedSpec,
48-
Bunch, InterfaceResult, md5, Interface,
48+
Bunch, InterfaceResult, Interface,
4949
TraitDictObject, TraitListObject, isdefined)
5050
from .utils import (generate_expanded_graph, modify_paths,
5151
export_graph, make_output_dir, write_workflow_prov,

nipype/pipeline/engine/workflows.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@
4141
from ...utils.functions import (getsource, create_function_from_source)
4242
from ...interfaces.base import (traits, InputMultiPath, CommandLine,
4343
Undefined, TraitedSpec, DynamicTraitedSpec,
44-
Bunch, InterfaceResult, md5, Interface,
44+
Bunch, InterfaceResult, Interface,
4545
TraitDictObject, TraitListObject, isdefined)
4646

47-
from ...utils.filemanip import (save_json, FileNotFoundError,
47+
from ...utils.filemanip import (save_json, FileNotFoundError, md5,
4848
filename_to_list, list_to_filename,
4949
copyfiles, fnames_presuffix, loadpkl,
5050
split_filename, load_json, savepkl,

nipype/utils/filemanip.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424

2525
from .. import logging, config
2626
from .misc import is_container
27-
from ..interfaces.traits_extension import isdefined
28-
2927
from future import standard_library
3028
standard_library.install_aliases()
3129

@@ -181,7 +179,9 @@ def fname_presuffix(fname, prefix='', suffix='', newpath=None, use_ext=True):
181179
pth, fname, ext = split_filename(fname)
182180
if not use_ext:
183181
ext = ''
184-
if newpath and isdefined(newpath):
182+
183+
# Avoid cyclic references importing isdefined
184+
if newpath and ('%s' % newpath) != '<undefined>':
185185
pth = os.path.abspath(newpath)
186186
return os.path.join(pth, prefix + fname + suffix + ext)
187187

0 commit comments

Comments
 (0)