Skip to content

Commit b587414

Browse files
authored
Merge pull request #1015 from EveCharbie/fix_continuity_controls
[RTR] UniquePerPhaseOPtionList -> OptionList ?
2 parents e32681a + 66f7876 commit b587414

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

bioptim/limits/phase_transition.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from ..misc.enums import Node, PenaltyType, InterpolationType
1212
from ..misc.fcn_enum import FcnEnum
1313
from ..misc.mapping import BiMapping
14-
from ..misc.options import UniquePerPhaseOptionList
14+
from ..misc.options import OptionList
1515

1616

1717
from ..misc.parameters_types import (
@@ -103,7 +103,7 @@ def _get_pool_to_add_penalty(self, ocp, nlp):
103103
return nlp.J_internal if nlp else ocp.J_internal
104104

105105

106-
class PhaseTransitionList(UniquePerPhaseOptionList):
106+
class PhaseTransitionList(OptionList):
107107
"""
108108
A list of PhaseTransition
109109

bioptim/limits/phase_transtion_factory.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,12 @@ def update_existing_transitions(self, phase_transition_list) -> list[PhaseTransi
7676
"""Update the existing phase transitions with Mayer functions and add cyclic transitions."""
7777
existing_phases = []
7878
for pt in phase_transition_list:
79-
idx_phase = pt.nodes_phase[0]
80-
self.check_phase_index(idx_phase)
81-
existing_phases.append(idx_phase)
82-
self.update_transition_base(pt)
83-
self.handle_cyclic_transition(idx_phase, pt)
79+
for transition in pt:
80+
idx_phase = transition.nodes_phase[0]
81+
self.check_phase_index(idx_phase)
82+
existing_phases.append(idx_phase)
83+
self.update_transition_base(transition)
84+
self.handle_cyclic_transition(idx_phase, transition)
8485
return self.full_phase_transitions
8586

8687
def prepare_phase_transitions(self, phase_transition_list: PhaseTransitionList) -> list[PhaseTransition]:

0 commit comments

Comments
 (0)