Skip to content

Commit f7021e5

Browse files
committed
fixed bug in state depth calculation where, single, combined states were being included
1 parent 4b97ed6 commit f7021e5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pydra/engine/state.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,13 +190,13 @@ def names(self):
190190

191191
@property
192192
def depth(self) -> int:
193-
"""Return the number of uncombined splits of the state, i.e. the number nested
193+
"""Return the number of splits of the state, i.e. the number nested
194194
state arrays to wrap around the type of lazy out fields
195195
196196
Returns
197197
-------
198198
int
199-
number of uncombined splits
199+
number of uncombined independent splits (i.e. linked splits only add 1)
200200
"""
201201
depth = 0
202202
stack = []
@@ -210,7 +210,8 @@ def depth(self) -> int:
210210
stack = []
211211
else:
212212
stack.append(spl)
213-
return depth + len(stack)
213+
remaining_stack = [s for s in stack if s not in self.combiner]
214+
return depth + len(remaining_stack)
214215

215216
@property
216217
def splitter(self):

0 commit comments

Comments
 (0)