CADETProcess.metric_space.Constraint#

class CADETProcess.metric_space.Constraint(metric: Metric, bound: float | ArrayLike = 0.0, comparison_operator: Literal['le', 'ge'] = 'le')[source]#

Bases: object

Operator/bound annotation on a metric; canonical form is g <= 0.

Parameters:
metricMetric

The annotated metric.

boundfloat or array-like

Constraint bound. A scalar applies to every entry; an array must match the metric’s n_metrics.

comparison_operator{“le”, “ge”}

Direction of the comparison: value <= bound or value >= bound.

property labels: list[str]#

Labels of the annotated metric, one per scalar entry.

property n_metrics: int#

Number of scalar entries of the annotated metric.

property name: str#

Name of the annotated metric.

violation(values: Any) ndarray[source]#

Signed violation in canonical g <= 0 form.

Positive entries violate the constraint. Returns a 1-D array of length n_metrics.