Family schemas¶
These keyword schemas fix the parameter names and argument structure that a call of a distribution family in QVR source must match (fixed and conditional families). They catch an error such as a scale keyword given where the family expects a rate before any backend distribution is built.
family_schemas
¶
QVR adapter for the dependency-free shared constructor schemas.
The core and source boundaries consume the same complete alternatives. This module retains the source tooling import path without maintaining another table.
DISTRIBUTION_FAMILIES
module-attribute
¶
DISTRIBUTION_FAMILIES: frozenset[str] = frozenset((*_FAMILY_PARAMETERS, *FAMILY_ALIASES))
Every distribution-family name accepted in QVR source.
Highlighters consume this set so their surface vocabulary follows the same schemas used by validation and lowering.
FAMILY_ALIASES
module-attribute
¶
Surface family names that resolve to another family's registry record.
A key is a name a source may write; its value is the family whose specification builds the distribution.
PARAMETER_ALIASES
module-attribute
¶
PARAMETER_ALIASES: dict[str, dict[str, str]] = {'LogitNormal': {'mu': 'loc', 'sigma': 'scale'}, 'TruncatedNormal': {'mu': 'loc', 'sigma': 'scale'}, 'Mixture': {'components': 'component'}, 'OrderedLogistic': {'predictor': 'eta'}, 'Pushforward': {'bijector': 'transforms'}}
Surface keywords that name a registry parameter under another name.
A family's entry maps each keyword a source may write to the registry parameter it fills, which means the same quantity. A keyword absent here and from the registry record names no parameter of the family.
family_parameter_names
¶
Return the canonical QVR keyword order for family.
| PARAMETER | DESCRIPTION |
|---|---|
family
|
The family name as written in source.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
tuple[str, ...] | None
|
The keyword names in canonical order, or None when no keyword
schema is declared for |
Source code in src/quivers/_family_schemas.py
family_parameterizations
¶
Return every complete keyword schema accepted by family.
| PARAMETER | DESCRIPTION |
|---|---|
family
|
The family name as written in source.
TYPE:
|
canonical
|
The parameter names the family's registry record declares,
used when no schema for
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
tuple[tuple[str, ...], ...]
|
One tuple of keyword names per accepted parameterization, empty when the family takes no parameters. |