Allow groups of phases to be added to trajectories. These phases will be placed into subgroups which can contain their own solvers and other group-level properties.
Issue Type
[ ] Bug
[x] Enhancement
Description
Currently, phases are added to a trajectory one phase at a time. At times, certain phases in a trajectory will have circular dependencies requiring that they be run in their own Group.
Rather than forcing all phases to be run in this iterative group, this change will allow subgroups to be run in parallel with other phases.
Example
Consider the following structure
Trajectory
Phases
Phase1
Group
Phase2
Phase3
Phase4
A new method will be added to Trajectory that allows a group of phases to be added to the phases subgroup. This group will be of class Group(). All phases within that group, and the group itself, will promote all inputs and outputs.
Here the use of kwargs will be deprecated in favor of phase_add_kwargs.
When adding multiple phases simultaneously:
name, phase, (and phase_add_kwargs if not None) should have the same length.
If group_name is provided
The added phases will be put in a subgroup group_name
If group_name is provided, the add_phase method will return the Group to which the phases will be added during setup. This group will need to be cached so that it can be added to phases during setup, but still available before that so properties like solvers can be set.
Summary of Issue
Allow groups of phases to be added to trajectories. These phases will be placed into subgroups which can contain their own solvers and other group-level properties.
Issue Type
Description
Currently, phases are added to a trajectory one phase at a time. At times, certain phases in a trajectory will have circular dependencies requiring that they be run in their own Group.
Rather than forcing all phases to be run in this iterative group, this change will allow subgroups to be run in parallel with other phases.
Example
Consider the following structure
This would be accomplished by doing the following
traj.add_phase('phase1', phase1) traj.add_phase(name=['phase2', 'phase3'], phase=[phase2, phase3], phase_add_kwargs=[kwargs2, kwargs3], group_name='subgroup1', **kwargs) traj.add_phase('phase4', phase4)
Proposed API:
A new method will be added to Trajectory that allows a group of phases to be added to the phases subgroup. This group will be of class Group(). All phases within that group, and the group itself, will promote all inputs and outputs.
The existing API is:
The new API will be:
Here the use of
kwargs
will be deprecated in favor ofphase_add_kwargs
.When adding multiple phases simultaneously:
name
,phase
, (andphase_add_kwargs
if not None) should have the same length.If group_name is provided, the add_phase method will return the Group to which the phases will be added during setup. This group will need to be cached so that it can be added to phases during setup, but still available before that so properties like solvers can be set.
Environment
N/A