Overview#

Core constraint framework including base classes.

Base Classes#

class biosym.constraints.base_constraint.BaseConstraint(model, settings, args)#

Bases: ABC

Abstract base class for constraints in the biosym package. All constraints should inherit from this class and implement the required methods.

abstractmethod get_confun(*args, **kwargs)#

Evaluate the constraint function.

Parameters:
  • args – Positional arguments for evaluation.

  • kwargs – Keyword arguments for evaluation.

Returns:

The constraint function.

abstractmethod get_jacobian(*args, **kwargs)#

Compute the Jacobian of the constraint function.

Parameters:
  • args – Positional arguments for Jacobian computation.

  • kwargs – Keyword arguments for Jacobian computation.

Returns:

The Jacobian of the constraint function.

abstractmethod get_n_constraints()#

Get the number of constraints defined by this constraint function.

Returns:

The number of constraints.

abstractmethod get_nnz()#

Get the number of non-zero entries in the Jacobian of the constraint function.

Returns:

The number of non-zero entries.