mario.parse_gloria
- mario.parse_gloria(
- path: str,
- table: str = 'SUT',
- valuation: str | int | list[str | int] | None = None,
- year: int | None = None,
- regions: str | list[str] | tuple[str, ...] | None = None,
- satellites: str | list[str] | tuple[str, ...] | None = 'all',
- dtype: str = 'float32',
- cache: bool | str | Path = False,
- model: str = 'Database',
- name: str | None = None,
- calc_all: bool = False,
- **kwargs,
Parse a locally downloaded GLORIA release.
The current GLORIA backend targets the monetary multi-regional SUT bundles shipped as raw
T,YandVcsv files together with the GLORIA ReadMe workbook. GLORIA IOT parsing is intentionally left for a later step.For full-region calculations, install the optional sparse solver with
conda install -c conda-forge scikit-umfpackor usepip install 'mariopy[umfpack]'after installing SuiteSparse. A full v060 reading has 19,680 activities and 19,680 commodities. Successful imports select session defaultssolve,directandsingular_policy='raise', preferring UMFPACK and falling back to SciPy if the optional backend cannot be imported. Defaults also affect other databases in this Python session and do not change the saved profile. Keepcalc_all=Falseto calculate only the matrices requested later.- Parameters:
path (str) – path to the GLORIA release root, to a Google Drive
part_Ieconomic-account folder, or directly to theGLORIA_MRIOs_*directory containing the raw csv files.table (str, optional) – currently only
SUTis supported.valuation (str, int, sequence or None, optional) –
None(default),basicand1read basic prices. A component such astradereads basic prices plus that signed adjustment. A sequence such as["trade", "transport"]adds each selected adjustment once. Components accept the corresponding markup numbers2-5. Use"purchaser"to sum the five signed layers of intermediate and final use. Supply, value added and the satellite accounts use Markup001. Use the basic-price database to calculate production coefficients and footprints, and the purchaser-price uses to value the same demand.year (int, optional) – reference year when the selected folder contains more than one yearly GLORIA bundle.
regions (sequence of str, optional) – optional subset of GLORIA region acronyms to keep.
satellites (str or sequence of str, optional) – satellite filter. Use
"all"for the full satellite account payload, pass one full label such as"Emissions | CO2", or one group name from the GLORIA ReadMe such as"Emissions".dtype (str, optional) – numeric dtype used for dense GLORIA blocks.
float32is the default because GLORIA use matrices are large.cache (bool or path-like, optional) – if
True, cache the parsed result as parquet under the GLORIA root and reuse it on subsequent calls when the raw file signature matches. A custom directory can also be provided.