Constraints

class ionworkspipeline.Constraint(fun, constraint_type)

A constraint is a function that takes the a dictionary of inputs and returns a value. For equality constraints, the function should evaluate to 0. For inequality constraints, the function should evaluate to a value greater than or equal to 0.

Parameters

funcallable

The constraint function. Should take a dictionary of inputs and return a value.

constraint_typestr

The type of constraint. Must be “eq” for equality constraints or “ineq” for inequality constraints.

set_x_to_inputs(x_to_inputs)

Set the function that converts the parameter vector to a dictionary of inputs.

Parameters

x_to_inputscallable

The function that converts the parameter vector to a dictionary of inputs. See ionworkspipeline.DataFit.x_to_inputs() for more information.