BPt.p.Scalar.register_cheap_constraint#

Scalar.register_cheap_constraint(func, as_layer=False)[source]#

Registers a new constraint on the parameter values.

Parameters
func: Callable

function which, given the value of the instance, returns whether it satisfies the constraints (if output = bool), or a float which is >= 0 if the constraint is satisfied.