The footprint notebook runs independently. Use the first part to inspect both HSUT and HIOT models; the footprint calculation needs the HIOT files only.

Import and inspect BONSAI#

Inputs · Local BONSAI Balanced HSUT and native b2 HIOT bundles. The companion uses the checked 20260615 directory and reference year 2016; record the actual files because a directory’s contents can be updated.

1 · Import

import mario

sut = mario.parse_bonsai(path="/path/to/Balanced/20260615.zip")
iot = mario.parse_bonsai(path="/path/to/HIOT/20260615", table="IOT")

Use the BONSAI guide for required files and optional UMFPACK installation before full-database calculations.

2 · Inspect one region

region = iot.get_index("Region")[0]
local_sectors = iot.get_index("Sector", region=region)
iot.units["Sector"].head()

Classifications vary by region. A global union of labels is not a list of sectors present in every region.

3 · Review the import

iot.info["bonsai"]
iot.info["bonsai"]["reference_products"]

Review unmatched final demand and elementary flows. Value-added inputs are unavailable; zero placeholders are not observed GDP or value added.

Continue with footprint coefficients

Request sut.fc for HSUT commodities or iot.f for HIOT sectors. Their denominators are the native product units. Use Calculate greenhouse gas emissions for a combined GHG indicator.

BONSAI’s solve/partial preset can return NaN where coefficients are not independently determined. Preserve them when summing with skipna=False.

Source and revision.

Read this notebook

GHG footprints#

Use BONSAI’s native b2 HIOT to calculate GHG footprint multipliers and compare them with the corresponding BONSAI GWP100 export. The notebook uses the 20260615 release folder; its contents can change, so record the files and their dates.

Inputs#

Obtain the HIOT files from the BONSAI team. Keep these four files from the same release in one directory:

  • extended_size_hiot.b2.pkl: native technosphere;

  • final_demand.b2.csv: final demand;

  • total_elementary_flow_w_iLUC.csv: elementary flows, including iLUC;

  • ghg_for_all.b2.GWP100.csv: BONSAI reference footprints.

The notebook includes access instructions and an optional UMFPACK installation step. Restart the kernel if that step installs packages. The footprint workflow uses the HIOT only; a Balanced HSUT is needed only for the optional HSUT import in the preceding section.

Calculation#

  1. Import the HIOT with mario.parse_bonsai(..., table="IOT") and inspect regional classifications, units and import diagnostics as above.

  2. Select UMFPACK and call calc_ghg(label="GHG"). MARIO’s BONSAI profile uses AR6 GWP100 by default, including the characterized accelerated-CO2 flow.

  3. Retain the GHG account and request db.f. These are footprints per native product unit, not total final-demand footprints. Units differ by product.

  4. Match MARIO and BONSAI results by region and product, then save footprint_ghg_comparison.csv.

The comparison reports (MARIO - BONSAI) / BONSAI: 0.01 means MARIO is 1% higher. Zero denominators and unmatched region/product pairs remain missing. Check the release, elementary flows and characterization factors before interpreting differences.

Source and revision.

Run the tutorial#

Download the notebook and its supporting files into one working folder. The notebook specifies the environment and source data.

Read this notebook