Derived

class pmrf.models.adapters.derived.Derived(operands: tuple[Any, dict[str, Any]], *, name: str | None = None, metadata: Any = None, fn: Callable[[...], Model])

Bases: AbstractBuilder

A model computed by a function from a base and new named parameters.

Built by derived(), which documents the contract. The base and the new parameters are held once, as operands = (base, new), and fn(base, **new) is called on their unwrapped values whenever the model is used. Parameter names see through this wrapper: the base’s names are unchanged and each new parameter is named by its keyword.

fn: Callable[[...], Model]

The function building the model from the base and the new parameters.

operands: tuple[Any, dict[str, Any]]

The base, and the new parameters keyed by keyword.