Skip to content

Commit 07b3a2b

Browse files
committed
Minimal viable product for interface specs as dicts
1 parent b9c75fb commit 07b3a2b

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

nipype/interfaces/base.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
99
Requires Packages to be installed
1010
"""
11-
from __future__ import print_function, division, unicode_literals, absolute_import
11+
from __future__ import print_function, division, absolute_import
1212
from future import standard_library
1313
standard_library.install_aliases()
1414
from builtins import range, object, open, str, bytes
@@ -760,7 +760,6 @@ class BaseInterface(Interface):
760760
This class cannot be instantiated.
761761
762762
"""
763-
input_spec = BaseInterfaceInputSpec
764763
_version = None
765764
_additional_metadata = []
766765
_redirect_x = False
@@ -771,6 +770,16 @@ def __init__(self, from_file=None, **inputs):
771770
raise Exception('No input_spec in class: %s' %
772771
self.__class__.__name__)
773772

773+
if isinstance(self.input_spec, dict):
774+
self.input_spec = type("AnonyomousInputSpec",
775+
(BaseInterfaceInputSpec,),
776+
self.input_spec)
777+
778+
if isinstance(self.output_spec, dict):
779+
self.output_spec = type("AnonyomousOutputSpec",
780+
(TraitedSpec,),
781+
self.output_spec)
782+
774783
self.inputs = self.input_spec(**inputs)
775784
self.estimated_memory_gb = 0.25
776785
self.num_threads = 1

0 commit comments

Comments
 (0)