@@ -1995,7 +1995,7 @@ class MapNode(Node):
1995
1995
1996
1996
"""
1997
1997
1998
- def __init__ (self , interface , iterfield , name , ** kwargs ):
1998
+ def __init__ (self , interface , iterfield , name , serial = False , ** kwargs ):
1999
1999
"""
2000
2000
2001
2001
Parameters
@@ -2012,6 +2012,8 @@ def __init__(self, interface, iterfield, name, **kwargs):
2012
2012
2013
2013
See Node docstring for additional keyword arguments.
2014
2014
"""
2015
+
2016
+
2015
2017
super (MapNode , self ).__init__ (interface , name , ** kwargs )
2016
2018
if isinstance (iterfield , str ):
2017
2019
iterfield = [iterfield ]
@@ -2020,6 +2022,8 @@ def __init__(self, interface, iterfield, name, **kwargs):
2020
2022
fields = self .iterfield )
2021
2023
self ._inputs .on_trait_change (self ._set_mapnode_input )
2022
2024
self ._got_inputs = False
2025
+
2026
+ self ._serial = serial
2023
2027
2024
2028
def _create_dynamic_traits (self , basetraits , fields = None , nitems = None ):
2025
2029
"""Convert specific fields of a trait to accept multiple inputs
@@ -2210,7 +2214,10 @@ def num_subnodes(self):
2210
2214
self ._get_inputs ()
2211
2215
self ._got_inputs = True
2212
2216
self ._check_iterfield ()
2213
- return len (filename_to_list (getattr (self .inputs , self .iterfield [0 ])))
2217
+ if self ._serial :
2218
+ return 1
2219
+ else :
2220
+ return len (filename_to_list (getattr (self .inputs , self .iterfield [0 ])))
2214
2221
2215
2222
def _get_inputs (self ):
2216
2223
old_inputs = self ._inputs .get ()
0 commit comments