cadrumo.domain.modelos.perceptor_clave_scope module¶
Registry-declared clave scope of perceptor-record casillas.
An informative withholding summary files one record per perceptor and clave, and its record design reserves many positions for particular claves only (“Solo para percepciones correspondientes a las claves …”). A casilla outside a record’s scope is left blank or zero-filled for that record, so it is not a required input there. The scope is registry data, authored per design edition in a governed mapping fact, never a list in code.
A scope token is CLAVE (every subclave) or CLAVE.SUBCLAVE.
The scope is evaluated against a ModeloRevision, whose export layouts
name each record’s row-field casillas and whose bindings fill them.
- class ClaveScopeToken(clave, subclave)[source]¶
Bases:
objectOne clave, optionally narrowed to a single subclave.
- class PerceptorClaveScope(modelo_id, row_clave_binding, row_subclave_binding, casillas, effective_date)[source]¶
Bases:
objectThe selected edition’s clave scope for one modelo’s perceptor casillas.
- Parameters:
-
row_clave_binding:
TypeAliasType¶
-
row_subclave_binding:
TypeAliasType¶
-
casillas:
Mapping[TypeAliasType,tuple[ClaveScopeToken,...]]¶
- resolve_perceptor_clave_scope(*, effective_date, authority=None)[source]¶
Resolve the clave scope declared for the filing period of
effective_date.- Return type:
- Parameters:
effective_date (date)
authority (GovernedFactSource | None)
- row_field_value_bindings(revision)[source]¶
Map each row-template casilla to the row-set binding that fills it.
The export record names the casilla of each row field, and the row-set binding names the row field it supplies for that record.
- Parameters:
revision (
ModeloRevision) – TheModeloRevisionwhose export layouts and bindings are joined on the record and row field they share.- Return type:
dict[TypeAliasType,TypeAliasType]
- rows_missing_scoped_casilla(scope, *, casilla_id, value_binding, row_binding_values)[source]¶
Return the rows inside
casilla_id’s clave scope that carry no value for it.A row is identified by its row-set index. A row whose clave the scope excludes owes the casilla nothing; every other row must carry a value, zero included.
- perceptor_clave_scope_failures(scope, *, casilla_ids, authority=None)[source]¶
Return every scope declaration the given revision surface cannot honour.
- Return type:
- Parameters:
scope (PerceptorClaveScope)
authority (GovernedFactSource | None)
- check_perceptor_clave_scope(modelo_id, casilla_ids, renta_first_slice_binding_targets, revision_binding_ids=frozenset({}))[source]¶
Assert the declared scope names real casillas and claves where it applies.
A revision that declares no per-record clave binding carries no perceptor records to scope, so the check has no claim over it.