Skip to content

Commit 164e6b1

Browse files
committed
fixing splitter2rpn, so it doesn't change State.other_splitter or State.splitter
1 parent 2f0ade0 commit 164e6b1

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

pydra/engine/helpers_state.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def splitter2rpn(splitter, other_states=None, state_fields=True):
3333
deepcopy(splitter),
3434
i=0,
3535
output_splitter=output_splitter,
36-
other_states=other_states,
36+
other_states=deepcopy(other_states),
3737
state_fields=state_fields,
3838
)
3939
return output_splitter

pydra/engine/state.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,17 +138,15 @@ def splitter_final(self):
138138
def splitter_rpn(self):
139139
# TODO NOW: this also changes other_states (properly, but should be explicite)
140140
_splitter_rpn = hlpst.splitter2rpn(
141-
deepcopy(self.splitter), other_states=self.other_states
141+
self.splitter, other_states=self.other_states
142142
)
143143
return _splitter_rpn
144144

145145
@property
146146
def splitter_rpn_compact(self):
147147
if self.other_states:
148148
_splitter_rpn_compact = hlpst.splitter2rpn(
149-
deepcopy(self.splitter),
150-
other_states=self.other_states,
151-
state_fields=False,
149+
self.splitter, other_states=self.other_states, state_fields=False
152150
)
153151
return _splitter_rpn_compact
154152
else:
@@ -175,7 +173,7 @@ def left_splitter(self):
175173
def left_splitter_rpn(self):
176174
if self.left_splitter:
177175
left_splitter_rpn = hlpst.splitter2rpn(
178-
deepcopy(self.left_splitter), other_states=self.other_states
176+
self.left_splitter, other_states=self.other_states
179177
)
180178
return left_splitter_rpn
181179
else:
@@ -186,9 +184,7 @@ def left_splitter_rpn_compact(self):
186184
# left rpn part, but keeping the names of the nodes, e.g. [_NA, _NB, *]
187185
if self.left_splitter:
188186
left_splitter_rpn_compact = hlpst.splitter2rpn(
189-
deepcopy(self.left_splitter),
190-
other_states=self.other_states,
191-
state_fields=False,
187+
self.left_splitter, other_states=self.other_states, state_fields=False
192188
)
193189
return left_splitter_rpn_compact
194190
else:
@@ -274,7 +270,6 @@ def update_connections(self, new_other_states=None, new_combiner=None):
274270
if new_other_states:
275271
self.other_states = new_other_states
276272
self._connect_splitters()
277-
self.splitter_rpn # TODO: temporary fix
278273
if new_combiner:
279274
self.combiner = new_combiner
280275
self.set_input_groups()
@@ -367,7 +362,7 @@ def _left_right_check(self, splitter_part, check_nested=True):
367362
def set_input_groups(self, state_fields=True):
368363
"""Evaluate groups, especially the final groups that address the combiner."""
369364
right_splitter_rpn = hlpst.splitter2rpn(
370-
deepcopy(self.right_splitter),
365+
self.right_splitter,
371366
other_states=self.other_states,
372367
state_fields=state_fields,
373368
)

0 commit comments

Comments
 (0)