foxes_opt.pipelines

Pipelines for combining multiple wind farm optimizations.

Starting from an initial layout

LayoutPipeline.run can pass a finite coordinate array directly to the first selected stage of a fresh pipeline run:

success, results = pipeline.run(initial_layout=layout_xy)

The array must have shape (n_turbines, 2). This starts a new run and does not continue callback numbering or optimization history.

Restarting a layout stage

LayoutPipeline.run can seed the first selected stage from a persisted layout callback snapshot. The numeric suffix is independent of zero padding:

success, results = pipeline.run(
    start_stage=1,
    restart_layout_index=188,
    restart_layout_dir="iterations",
)

Relative restart directories resolve below the pipeline base directory. The loader requires exactly one matching layout_<index>.csv with finite x and y coordinates, the expected turbine order when an index column is present, and shape (n_turbines, 2).

Constraint-family parameters

LayoutOptimizerStage keeps automatically generated minimum-distance constraint parameters separate from explicit constraint entries. This permits independent feasibility tolerances:

stage = LayoutOptimizerStage(
    optimizer_family="iwopy",
    optimizer_pars={"optimizer": "SLSQP", "max_iterations": 100},
    constraints=[
        {"constraint_type": "FarmBoundaryConstraint", "tol": 0.5},
    ],
    min_dist=2.5,
    min_dist_unit="D",
    min_dist_constraint_pars={"tol": 0.01},
)

The constraint objects own these tolerances; the optimizer derives its solver bounds from the registered constraints.

Optimizer selection

optimizer_family selects the iwopy factory backend. optimizer_pars requires an optimizer algorithm name and otherwise contains explicit iwopy controls and flat native options. For example, use optimizer_family="scipy" with optimizer_pars={"optimizer": "trust-constr", "max_iterations": 100} for sparse native constraint Jacobians. boundary_repair_optimizer_family optionally selects another backend for repair; boundary_repair_optimizer_pars overrides the main algorithm selector and options for that run.

Use iwopy’s max_iterations and max_evaluations only where the selected adapter supports their units. SLSQP and IPOPT support iteration limits, not portable evaluation caps. pymoo supports both but checks evaluation caps at generation boundaries. pop_size is algorithmic population size, not a pending ask/evaluate batch. See the iwopy parameter and termination tables.