gcubed.data.logged_zero_preparation
Shared preparation and validation of logged database observations.
Fail closed when a serialized working database predates this policy.
Reject a derived database before any unit transformation can repeat.
Replace eligible exact zeros while retaining explicitly deferred rows.
Overview
Applies the common pre-log zero treatment, while allowing an explicit, tightly scoped set of later-generated rows to remain missing.
Arguments
data: Database observations at the shared pre-log reference stage.variable_summary: Model metadata indexed by fully articulated names.zero_variables_selector: Rows excluded from logarithmic treatment.allowed_missing_variable_names: Active logged rows calculated by a later database-generation stage. Deferral permits missing values only; negative and infinite values remain invalid.
Returns
Compact provenance for each exact-zero substitution.
Exceptions
Raises ValueError when a deferred name is ineligible or a non-deferred
logged observation is non-finite or negative.
Require selected active logged observations to be finite and positive.
Overview
Validates final values for every active logged row or a named eligible subset, so a producer can be checked at the stage where it has finished.
Arguments
data: Database values to validate.variable_summary: Model metadata indexed by fully articulated names.zero_variables_selector: Rows excluded from logarithmic treatment.variable_names: Optional active logged rows to validate. Omitting it validates every active logged row.stage: Description included in an error message to locate the producer.
Returns
None.
Exceptions
Raises ValueError when a selected name is ineligible or an observation is
non-finite or non-positive. Selecting only later-stage rows avoids treating
intentionally unpopulated model families as final-data errors.
Add database-specific scaling and final stored values to provenance.
G-Cubed