aeat.domain.calculations.registry._formula_initial_values module

Initial-value assembly for registry formula evaluation.

The ModeloRevision declares the casilla and binding slots that seed aeat.domain.calculations.registry._formula_runtime.calculate_registry_snapshot(); materialisation emits CasillaObservation rows carrying registry provenance.

See also

aeat.domain.calculations.registry._formula_runtime

Runtime caller that consumes the initial values and materialised observations produced here.

aeat.domain.calculations.registry._bindings

Binding helpers that resolve bound casilla values and equivalent binding groups before provenance materialisation.

aeat.domain.calculations.registry._bindings_previous_filing

Previous-filing selector model used to decide whether a missing bound slot is absent by design for the target period.

materialise_observations(*, values, computed_provenance, casillas_by_id, absent_by_design_casilla_ids=frozenset({}))[source]

Project per-casilla runtime state into the canonical observation tuple.

Each returned CasillaObservation is either preserved from computed provenance or rebuilt from a CasillaDefinition legal/source reference set.

Return type:

tuple[CasillaObservation, ...]

Parameters:
initial_values(revision, inputs, *, binding_values, target_period)[source]

Build initial numeric casilla values and absent-by-design markers.

The ModeloRevision supplies CasillaId membership, formula targets, and BindingId slots before formula evaluation starts.

Return type:

tuple[dict[TypeAliasType, Decimal], frozenset[TypeAliasType]]

Parameters:
initial_value_casilla_ids(revision)[source]

Return casilla ids seeded before registry formula evaluation.

Source-resolution preview passes can use this to distinguish declared or bound input slots from values that only exist after the formula engine runs. It is intentionally descriptive only; computed casillas still cannot be supplied through the input channel. revision is the compiled ModeloRevision whose casillas are scanned for their declared input_kind.

Return type:

frozenset[TypeAliasType]

Parameters:

revision (ModeloRevision)

binding_values_with_absent_by_design_defaults(revision, binding_values, *, target_period)[source]

Add structural zeroes for absent-by-design binding slots.

The ModeloRevision binding declarations are inspected through DataBindingDefinition so previous-filing and relation-prefill slots can default only when the selected target period has no required source period.

Return type:

dict[TypeAliasType, Decimal]

Parameters: