descriptors
Computation descriptor abstractions.
Provides FitterDescriptor and EvaluatorDescriptor for declaring
metadata about fitters and evaluators.
- class pysatl_core.distributions.computations.descriptors.EvaluatorDescriptor(name, target, sources, characteristic_options=(), computation_options=(), constraint_tags=<factory>, description='', evaluator=None)[source]
Bases:
_BaseDescriptorComplete metadata for a non-cacheable evaluator.
An evaluator is lightweight and called on every query without caching. It returns the computed value directly rather than a
FittedComputationMethod.- Parameters:
name (
str) – Unique human-readable identifier.target (
GenericCharacteristicName) – Characteristic produced by this evaluator.sources (
Sequence[GenericCharacteristicName]) – Characteristics consumed by this evaluator (typically length 1).evaluator (
EvaluatorFunc) – The actual evaluator callable.characteristic_options (
tuple[CharacteristicOption,]) – Options intrinsic to the characteristic (shared with fitters). These affect the meaning of the result.computation_options (
tuple[ComputationOption,]) – Options controlling the numerical algorithm used on every call. Unlike fitter computation options (used once at fit-time), evaluator computation options are applied on each invocation. Examples: integration tolerance, finite-difference step, iteration limit.constraint_tags (
frozenset[str]) – Constraint tags used for matching.description (
str) – Human-readable summary of what the evaluator does.
-
evaluator:
TypeAliasType
- to_computation_method()[source]
Build an EvaluatorMethod (computation method) from this descriptor.
- Return type:
EvaluatorMethod
- __init__(name, target, sources, characteristic_options=(), computation_options=(), constraint_tags=<factory>, description='', evaluator=None)
- Parameters:
name (str)
target (GenericCharacteristicName)
sources (Sequence[GenericCharacteristicName])
characteristic_options (tuple[CharacteristicOption, ...])
computation_options (tuple[ComputationOption, ...])
description (str)
evaluator (EvaluatorFunc)
- Return type:
None
- class pysatl_core.distributions.computations.descriptors.FitterDescriptor(name, target, sources, characteristic_options=(), computation_options=(), constraint_tags=<factory>, description='', fitter=None)[source]
Bases:
_BaseDescriptorComplete metadata for a cacheable fitter.
A fitter performs expensive precomputation and returns a
FittedComputationMethodthat can be cached and reused.- Parameters:
name (
str) – Unique human-readable identifier (e.g."pdf_to_cdf_1C").target (
GenericCharacteristicName) – Characteristic produced by this fitter.sources (
Sequence[GenericCharacteristicName]) – Characteristics consumed by this fitter (typically length 1).fitter (
FitterFunc) – The actual fitting callable.characteristic_options (
tuple[CharacteristicOption,]) – Options intrinsic to the characteristic (shared with evaluators, encoded into the cache key).computation_options (
tuple[ComputationOption,]) – Options controlling the numerical algorithm (fitter-specific).constraint_tags (
frozenset[str]) – Constraint tags used for matching (e.g.{"continuous", "univariate"}).description (
str) – Human-readable summary of what the fitter does.
Notes
The combined
optionsproperty returns all options (characteristic first, then computation) for backwards-compatible resolution.-
fitter:
TypeAliasType
- to_computation_method()[source]
Build a FitterMethod (computation method) from this descriptor.
- Return type:
FitterMethod
- __init__(name, target, sources, characteristic_options=(), computation_options=(), constraint_tags=<factory>, description='', fitter=None)
- Parameters:
name (str)
target (GenericCharacteristicName)
sources (Sequence[GenericCharacteristicName])
characteristic_options (tuple[CharacteristicOption, ...])
computation_options (tuple[ComputationOption, ...])
description (str)
fitter (FitterFunc)
- Return type:
None