modosaic.core.validation_constraint¶
modosaic.core.validation_constraint ¶
ValidationConstraint
dataclass
¶
ValidationConstraint(minimum, score_fn=None, score_name='score')
Quality gate applied to a validator value.
Attributes:
| Name | Type | Description |
|---|---|---|
minimum |
float
|
Inclusive minimum score needed for a pass. |
score_fn |
Callable[[U], float] | None
|
Optional converter from a structured validator value to a numeric score. |
score_name |
str
|
Human-readable score name stored in validation output. |
evaluate ¶
evaluate(value)
Evaluate a validator value against the configured minimum.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
U
|
Raw validator output. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float, bool]
|
A tuple containing the numeric score and whether the score passed. |
Raises:
| Type | Description |
|---|---|
TypeError
|
If no |
Source code in modosaic/core/validation_constraint.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |