parametrizations
Parameterization classes and specifications for distribution families.
This module provides the core abstractions for defining different parameterizations of statistical distributions, including constraints validation and conversion between parameterization formats.
- class pysatl_core.families.parametrizations.ParametrizationConstraint(description, check)[source]
Bases:
objectConstraint on parameter values for a parametrization.
- Parameters:
description (
str) – Human-readable description of the constraint.check (
Callable[[Any],bool]) – Validation function that returns True if constraint is satisfied.
- class pysatl_core.families.parametrizations.Parametrization[source]
Bases:
ABCAbstract base class for distribution parametrizations.
This class defines the interface for parametrizations, including parameter validation and conversion to base parametrization format.
- property constraints: list[ParametrizationConstraint]
Get constraints for this parametrization.
- validate()[source]
Validate all constraints for this parametrization.
- Raises:
ValueError – If any constraint is not satisfied.
- Return type:
- pysatl_core.families.parametrizations.constraint(description)[source]
Decorator to mark an instance method as a parameter constraint.
- Parameters:
description (
str) – Human-readable description of the constraint.- Returns:
Decorator that marks the function as a constraint.
- Return type:
Callable[[Callable[P,bool]],Callable[P,bool]]
Notes
The decorated function must be a predicate returning bool. Sets marker attributes on the function: - __is_constraint: True - __constraint_description: description
- pysatl_core.families.parametrizations.parametrization(*, family, name)[source]
Decorator to register a class as a parametrization for a family.
- Parameters:
family (
ParametricFamily) – Family to register the parametrization with.name (
str) – Name of the parametrization.
- Returns:
Class decorator that registers the parametrization.
- Return type:
Callable[[type[Parametrization]],type[Parametrization]]
Notes
Automatically converts the class to a dataclass if not already one. Collects and registers constraint methods marked with @constraint.