Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions tests/shard6/test_penalty.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
MultinodeConstraintList,
MultinodeConstraint,
MultinodeObjective,
MultinodeObjectiveFcn,
MultinodeObjectiveList,
Node,
ControlType,
PhaseDynamics,
Expand Down Expand Up @@ -207,6 +209,17 @@ def test_penalty_targets_shapes():
npt.assert_equal(Objective([], custom_type=p, target=np.array([[1, 2]])).target.shape, (1, 2))


def test_multinode_objective_default_weight_is_one():
objectives = MultinodeObjectiveList()
objectives.add(
MultinodeObjectiveFcn.STATES_EQUALITY,
nodes=(Node.START, Node.END),
nodes_phase=(0, 0),
)

npt.assert_equal(objectives[0].weight, ObjectiveWeight(1))


@pytest.mark.parametrize("phase_dynamics", [PhaseDynamics.SHARED_DURING_THE_PHASE, PhaseDynamics.ONE_PER_NODE])
@pytest.mark.parametrize("penalty_origin", [ObjectiveFcn.Lagrange, ObjectiveFcn.Mayer])
@pytest.mark.parametrize("value", [0.1, -10])
Expand Down
Loading