initialize_constraints
despasito.parameter_fitting.fit_functions.initialize_constraints
- initialize_constraints(constraints, constraint_type)[source]
A tuple of either constraint classes or dictionaries as required by
global_methods.- Parameters:
constraints (dict) – This dictionary of constraint types and their arguments will be converted into the appropriate form for the chosen optimization method. Although the key can be anything, it must represent a dictionary containing:
function (str) - must be found in the dictionary and represent a valid
function name from
constraint_types* type - entries depends onconstraint_type* args - Inputs into the functions (keys)constraint_type (str) – Either ‘dict’ or ‘class’. Changes the constraint to the specified form.
‘dict’: Allowed types, “eq” or “ineq”, eq means must be zero, ineq means it
must be non-negative * ‘class’: Allowed types, “nonlinear” or “linear”, a keyword argument may also be added for the constraint class
- Returns:
new_constraints – A tuple of either constraint classes or dictionaries as required by global optimization methods
- Return type:
tuple