cadrumo.domain.calculations.registry.m303_orden_constants module

Shared shape constants and coordinate validation for annual Orden authority.

MINIMUM_SEASONAL_INDEX_BANDS

Shape bounds for the temporada corrector bands, NOT their values. The coefficients and day bands are fixed by each annual Orden and are already grounded in the census by its own required_text; asserting them here would make a lawful change to a coefficient indistinguishable from a corrupt extraction, and the validator would refuse the new law. What is safe to assert is that the bands remain a contiguous ascending partition carrying positive coefficients, which a garbled extraction would violate.

validate_generated_source_counts(source)[source]

Validate generated M303 source counts against structural expectations.

Return type:

None

Parameters:

source (_GeneratedSourceShape)

validate_generated_source_axis_shape(source)[source]

Validate that generated M303 source axes have the required shape.

Return type:

None

Parameters:

source (_GeneratedSourceShape)

validate_seasonal_index_shape(day_bands, coefficients, *, scope)[source]

Refuse a temporada corrector table that is structurally impossible.

Asserts SHAPE, never the legal figures: the bands must be a contiguous ascending partition starting at day one, each band non-empty, with one positive coefficient apiece. A future Orden may change any coefficient or band boundary and still satisfy this; a garbled extraction cannot.

Raises:

RegistryValidationError – If the table is empty, misaligned, or carries a non-positive coefficient.

Return type:

None

Parameters:
validate_percentage_shape(percentage, *, scope, subject)[source]

Refuse a percentage outside the only range a percentage can occupy.

Asserts SHAPE, never the legal figure, for the same reason as validate_seasonal_index_shape().

Raises:

RegistryValidationError – If percentage is negative or above 100.

Return type:

None

Parameters:
validate_2022_annual_orden_coordinate(*, ejercicio, registry_revision_id, source_ref, source_content_digest, scope)[source]

Require the pinned BOE/revision coordinate for 2022 annual authority.

Return type:

None

Parameters:
  • ejercicio (int)

  • registry_revision_id (RevisionId)

  • source_ref (SourceRefId)

  • source_content_digest (str)

  • scope (str)