citrine.informatics.constraints.ingredient_count_constraint module
- class citrine.informatics.constraints.ingredient_count_constraint.IngredientCountConstraint(*, formulation_descriptor: FormulationDescriptor, min: int, max: int, label: str | None = None)
Bases:
Serializable
[IngredientCountConstraint
],Constraint
Represents a constraint on the total number of ingredients in a formulation.
- Parameters:
formulation_descriptor (FormulationDescriptor) – descriptor to constrain
min (int) – minimum ingredient count
max (int) – maximum ingredient count
label (Optional[str]) – Optional label to constrain. If specified, then only ingredients with the specified label will count towards the total. Default is
None
; all ingredients count towards the total
- classmethod build(data: dict) Self
Build an instance of this object from given data.
- dump() dict
Dump this instance.
- classmethod get_type(data)
Return the subtype.
- formulation_descriptor: FormulationDescriptor = None
- label: str | None = None
- max: int = None
- min: int = None
- typ = 'IngredientCountConstraint'