Inspect production mixes provides a task guide and a minimal example.

Database.get_mix(sectors, *, scenario: str = 'baseline') → dict[str, dict[str, float]]#

Return one region-by-sector production mix from X.

Parameters:
  • sectors – Non-empty iterable of sector labels whose regional production mix should be calculated. The special string "electricity" uses the same generation-sector bundle resolved by update_supply_mix().

  • scenario – Scenario whose production vector should be converted to one region -> {sector: share} mapping.

Returns:

Nested dictionary keyed first by Region and then by Sector.

Return type:

dict[str, dict[str, float]]

Notes

This helper is currently implemented only for IOT tables. For each region, the selected sector values are normalized by the total production of the same selected sector bundle in X. Regions with zero total production over the selected sectors return zero shares. With region-specific classifications, only sectors present in each region are included; a region without selected sectors returns {}. The selected productions must have comparable units. On transformed hybrid IOTs, this reference-product mix need not equal historical physical generation when by-product outputs have no independent nodes. The resulting mapping is also stored on self.mix.