SGD DistanceConstraintAggregation order of contraints bug
If the order of the constraints is switched below, the code errors out:
DistanceConstraintAggregation(
[ # TODO: BUG; must maintain the order of constraints
SpacingConstraint(min_spacing=min_spacing),
constraint_comp,
],
n_wt=n_wt * 2,
min_spacing_m=min_spacing,
windTurbines=wind_turbines,
)
I found out about this in reading sgd_slsqp_comparison.ipynb
:
... The constraints for the SGD driver are defined with the DistanceConstraintAggregation class.
Note: as the class is specified, the order of the SpacingConstraint and XYBoundaryConstraint **must** be kept as shown in this example.
Seems quite unreasonable to leave this out for a user to find out by themselves. An easy workaround could be ordering the list in the class before anything else. Or fixing the issue... Could take a shot at this once we have a direction : )