G-Cubed
Python G-Cubed 5.0.2.0 · build 1
Generation details
Source revision
4c4a95aded1b5ca5e8f9c292ad8250440cd9c18b (modified inputs)
Source fingerprint
e2c719b38e03c6b1748f10e26bc1caf1ead5674dd1beee6628a6ccf7b90fd39b
Generated (UTC)
2026-11-11T03:06:22.844261+00:00
Generator
pdoc 16.0.0, CPython 3.14.8
Generation metadata

gcubed.data.linearisation_database

This module contains the LinearisationDatabase class, used for model linearisation.

class LinearisationDatabase(gcubed.data.database.Database):

Overview

Provides convenience methods for all classes.

All G-Cubed classes inherit from this base class.

LinearisationDatabase( database: gcubed.data.database.Database, base_year: int, allowed_missing_logged_variable_names: Collection[str] = ())

Constructor

Manage loading and provision of linearisation database.

Encapsulates all of the information about the linearisation data used by a Model.

Note that this data differs from that used for model calibration in that the data for gdp unit variables has been scaled by the GDP ratio for each region to the US.

Arguments

database: the database that this linearisation database was derived from.

base_year: the base year for the database.

allowed_missing_logged_variable_names: active logged values that are intentionally calculated by a later database-generation stage. Missing values are retained for these rows; negative and infinite values remain invalid.

Exceptions

Raises ValueError when logged observations are invalid, except for explicitly deferred missing rows.

The SYM processor output

The model configuration details

logged_zero_preparation_policy_version: str

Version of the logged-zero preparation applied to this database.

logged_zero_preparation_diagnostics: pandas.DataFrame

Return substitution provenance without exposing mutable internal state.

def rebase(self):

Rebase a database so indices have a new base year. This can be used to convert the database used for calibration to a database with the base year equal to the start year for projections (eg. 2011 to 2018).

Note that this script draws on the approach in the G-Cubed utilities/rebasedata.ox script.

Arguments

 new_base_year (int): a YYYY formatted new base year for the database.

Exceptions

Exception is thrown if the database does not contain data for the new base year.

Exception is thrown if the database does not contain data for the year after the new base year if the model has lagged index variables.