bluemira.optimisation.typed

Types for the optimisation module.

Classes

ObjectiveCallable

Form for an optimiser objective function.

OptimiserCallable

Form for an non-objective optimiser function.

ConstraintT

Typing for definition of a constraint.

Module Contents

class bluemira.optimisation.typed.ObjectiveCallable

Bases: Protocol

Inheritance diagram of bluemira.optimisation.typed.ObjectiveCallable

Form for an optimiser objective function.

__call__(vector: numpy.ndarray) float

Call the objective function.

Parameters:
  • x – The optimisation parameters.

  • vector (numpy.ndarray)

Return type:

float

class bluemira.optimisation.typed.OptimiserCallable

Bases: Protocol

Inheritance diagram of bluemira.optimisation.typed.OptimiserCallable

Form for an non-objective optimiser function.

This is the form for a gradient, constraint, or constraint gradient.

__call__(vector: numpy.ndarray) numpy.ndarray

Call the optimiser function.

Parameters:
  • x – The optimisation parameters.

  • vector (numpy.ndarray)

Return type:

numpy.ndarray

class bluemira.optimisation.typed.ConstraintT

Bases: TypedDict

Inheritance diagram of bluemira.optimisation.typed.ConstraintT

Typing for definition of a constraint.

name: NotRequired[str]
f_constraint: OptimiserCallable
tolerance: numpy.ndarray
df_constraint: NotRequired[OptimiserCallable | None]