gcubed.data.fiscal_accounts
Coordinate-explicit fiscal arithmetic shared by generation and conditioning.
Country source selection belongs to msgdata; this module has no data-package dependency.
Overview
Bound an additive stored-unit residual by seven-decimal and floating rounding.
Arguments
terms: Finite signed operands in the same stored units, with one possible seven-decimal rounding contribution per operand.Returns
An absolute residual bound; an empty sum has a zero bound.
Exceptions
Raises ValueError when any operand or the resulting bound is nonfinite.
Overview
Read selected fiscal equations, rejecting unsupported or ambiguous closures. Includes resolve from the model's SYM root, as they do in the SYM processor.
Arguments
sym_input_file: Selected native source and its included closure files.Returns
Eight canonical standard equations. The supported paired permit closure adds
DEFI(USA) and retains its non-USA expression under DEFI.
Exceptions
Raises ValueError for invalid includes or unsupported, partial or ambiguous
fiscal equations. No files are changed.
Overview
Return TAXS/TAXL/TAXT/DEFN from accepted unlogged decimal working levels. Rows are unique region/year coordinates; all eleven required inputs must be finite. Rates are decimals, and all fiscal levels share the same GDP basis. This pure calculation neither changes source anchors nor clips signed remainders. Callers must validate the active closure before applying its result.
Arguments
accounts: Required fiscal inputs and optional decimalGOVERNMENT_PERMIT_RECEIPTS, positive for government receipts.Returns
A new derived-account frame, deducting supplied permits from the TAXS residual.
Exceptions
Raises ValueError for invalid labels or nonfinite fiscal inputs/results.
Overview
Read the native government permit receipts in unlogged stored GDP units.
Arguments
data: Stored CSV values with units and region labels.regions,years: Receipt coordinates; years are stored string labels.equations: Validated standard or paired USA/non-USA fiscal equations.Returns
Region/year receipts. Standard budgets receive zeros; permit budgets use supplied PBGU for USA and PBG divided by real FX for every other region. No regional aggregation or firm-permit receipts participate.
Exceptions
Raises ValueError for unsupported equations, malformed domains, nonfinite
values, invalid units or nonpositive real exchange rates.
Overview
Reconcile fiscal components and native savings in unlogged stored coordinates. GDP-unit levels and rates are stored in percent; price/real-FX indices are stored with 100 as unity. Optional TAXM/TAXX/TAXE terms and the entire foreign account block may be structurally absent. Partial blocks, units/domain drift and nonfinite inputs fail before mutation. The input is never changed.
Arguments
data: Labelled stored values, including units and regional identifiers.regions,years: Required calculation coordinates.preserve_taxs: Check the supplied non-interest remainder against the stored rounding bound and use it in TAXL/TAXT. The default retains generation's calculated remainder. Callers project optional tax rows to their selected native revenue terms before requesting preservation.permit_receipts: Current stored-GDP government receipts, labelled by region/year;Noneretains budgets without government permit receipts.reference_permit_receipts: Original receipts used to validate preserved TAXS before applying only the receipt change; defaults to current receipts.Returns
A new frame of derived fiscal and applicable native savings values.
Exceptions
Raises ValueError for invalid labels, units, nonfinite inputs/results or
an inconsistent preserved TAXS, identifying its region/year.
G-Cubed