computation

Computation Primitives and Conversions

Core building blocks for computing distribution characteristics and conversions between them (e.g., PDF to CDF, CDF to PPF).

class pysatl_core.distributions.computation.Computation(*args, **kwargs)[source]

Bases: Protocol, Generic

Protocol for computations that evaluate a single characteristic.

target

Name of the characteristic this computation produces.

Type:

str

property target: GenericCharacteristicName
__init__(*args, **kwargs)
class pysatl_core.distributions.computation.FittedComputationMethodProtocol(*args, **kwargs)[source]

Bases: Protocol, Generic

Protocol for fitted computation methods ready for evaluation.

target

Destination characteristic name.

Type:

str

sources

Source characteristic names this method depends on.

Type:

Sequence[str]

property target: GenericCharacteristicName
property sources: Sequence[GenericCharacteristicName]
__init__(*args, **kwargs)
class pysatl_core.distributions.computation.ComputationMethodProtocol(*args, **kwargs)[source]

Bases: Protocol, Generic

Protocol for computation method factories that can be fitted to distributions.

property target: GenericCharacteristicName
property sources: Sequence[GenericCharacteristicName]
fit(distribution, **options)[source]
Return type:

FittedComputationMethodProtocol[typing.Any, typing.Any]

Parameters:
__init__(*args, **kwargs)
class pysatl_core.distributions.computation.AnalyticalComputation(target, func)[source]

Bases: Generic

Analytical computation provided directly by a distribution.

Parameters:
  • target (str) – Characteristic name (e.g., “pdf”, “cdf”).

  • func (Callable[[In, KwArg(Any)], Out]) – Analytical function that computes the characteristic.

target: TypeAliasType
func: Callable[[TypeVar(In), Any], TypeVar(Out)]
__call__(data, **options)[source]

Evaluate the analytical function at the given data.

Return type:

typing.Any

Parameters:
__init__(target, func)
Parameters:
Return type:

None

class pysatl_core.distributions.computation.FittedComputationMethod(target, sources, func)[source]

Bases: Generic

Fitted conversion method ready for use.

Parameters:
  • target (str) – Destination characteristic name.

  • sources (Sequence[str]) – Source characteristic names (typically length 1 for unary conversions).

  • func (Callable[[In, KwArg(Any)], Out]) – Callable implementing the fitted conversion.

target: TypeAliasType
sources: Sequence[TypeAliasType]
func: Callable[[TypeVar(In), Any], TypeVar(Out)]
__call__(data, **options)[source]

Evaluate the fitted conversion at the given data.

Return type:

typing.Any

Parameters:
__init__(target, sources, func)
Parameters:
Return type:

None

class pysatl_core.distributions.computation.ComputationMethod(target, sources, fitter)[source]

Bases: Generic

Factory for creating fitted computation methods.

This class represents a conversion method that needs to be fitted to a specific distribution before it can be used.

Parameters:
  • target (str) – Destination characteristic name.

  • sources (Sequence[str]) – Source characteristic names (typically length 1 for unary conversions).

  • fitter (Callable[[Distribution, **options], FittedComputationMethod]) – Function that fits the computation method to a distribution.

target: GenericCharacteristicName
sources: Sequence[GenericCharacteristicName]
fitter: Callable[[Distribution, KwArg(Any)], FittedComputationMethod[In, Out]]
fit(distribution, **options)[source]

Fit the computation method to a specific distribution.

Parameters:
  • distribution (Distribution) – Distribution to fit the computation method to.

  • **options (Any) – Additional options passed to the fitter.

Returns:

Fitted method ready for evaluation.

Return type:

FittedComputationMethod

__init__(target, sources, fitter)
Parameters:
Return type:

None