FIGARO E3
Read local FIGARO-E3 supply/use and B/D input-output tables with employment, energy and emissions.
Download the CSV files and classifications from the JRC FIGARO-E3 collection. Keep the extracted files under one root; distribution subfolders are allowed. Import the complete supply-use system:
from pathlib import Path
import mario
root = Path("/path/to/FIGARO E3")
db = mario.parse_figaro_e3(
path=root, table="SUT", year=2015, employment="both", calc_all=False,
)
The published system has 46 regions, including Rest of the World, 176
activities and 213 commodities. S is transposed from the source supply
table; U and Yc retain commodity origins and industry/final-demand
destinations. All 11 primary-input and adjustment rows are retained, including
their direct final-demand values in VY. Native codes remain the model
labels; db.info["figaro_e3"]["classifications"] supplies their descriptions.
The parser applies a targeted numerical correction to the isolated Irish
paper-incineration loop in the published 2015 tables. Its default
diagonal_correction=1e-3 makes that component invertible and records the
changed cell and output reference. Set diagonal_correction=None to retain
the uncorrected singular source system. See Leontief singularity for the
modelling assumption and accounting gap.
Choose files and formats#
Economic data is published as a wide matrix_*.csv or a long
flatfile_*.csv. Both representations are supported. input_format="auto"
prefers economic matrices and uses an available flat file where needed.
Select "matrix" or "flatfile" to require that format for all inputs.
Flat files are read in chunks; the full table is retained in the model.
The checked 2015 industry IOT representations agree in Z and Y, but
differ in the medium-skill labour and net-operating-surplus primary accounts.
They must not be treated as identical copies for value-added analysis.
The parser retains the selected source’s primary accounts; it does not
reconcile them. Choose the format explicitly when comparing those results.
The classification workbook is required for every parse. Choose the remaining files according to the requested system:
System |
Filename stems, after |
|---|---|
SUT |
|
Industry IOT |
|
Product IOT |
|
Model D is industry-by-industry; model B is product-by-product. They are different economic tables, rather than duplicate downloads:
industry = mario.parse_figaro_e3(
path=root, table="IOT", iot_mode="industry", year=2015,
)
product = mario.parse_figaro_e3(
path=root, table="IOT", iot_mode="product", year=2015,
extensions=False,
)
The shared entry point also accepts
mario.parse_figaro(path=root, variant="E3", table="SUT"). Standard
FIGARO retains its Eurostat API workflow. E3’s default IOT mode is industry,
matching the native extension axes. E3 keeps its own classification and does
not inherit the standard 64-industry FIGARO concordances.
Browser suffixes such as copy, -2 and (1) are accepted when the
candidate files are byte-identical. Conflicting copies or classification
revisions raise an error: put the chosen release in a separate directory.
The parser does not infer a preferred revision from download timestamps.
The GAMS construction-code archive is not required for importing the CSVs.
Select extensions#
extensions="all" reads emissions, energy and employment. Select individual
groups with a list, or pass extensions=False for economic flows alone.
The groups have different alternatives and accounting scopes:
emissions="co2eq"imports the published four-gas AR5/GWP100 CO2eq account, fromAEM_Gg_CO2efiles.emissions="mass"selectsAEM_Gg: CO2, CH4 and N2O are in kt of each gas, while F-gases remain in kt CO2eq. Import one inventory at a time. A Gg is numerically one kt.Energy includes PES, NEU, FEU, EOU, LOSS and NENE in TJ. Auto uses the complete
flatfile_FIGARO-e_ENE_TJ_2015.csvwhen available; matrix-only parsing requires all six indicator files. Energy indicators overlap: FEU, EOU and LOSS are components of NEU, so summing the rows is not an energy footprint.employment="EDU"(default) and"OCC"are alternative estimates based on education and occupation."both"retains them as separately labelled six-row inventories. Do not add the two methods together. Employment is in thousand persons and has no direct final-demand extension.
Direct final-demand emissions and energy are aligned by their codes, including the published extension files’ different final-demand ordering and trailing spaces. Source signs are preserved, including negative energy/adjustment flows.
For the already characterised CO2eq account:
db.calc_ghg(profile="figaro_e3", label="GHG source AR5 GWP100")
This sums the four gas rows, including direct final demand, once. Changing an IPCC report or time-horizon argument does not recharacterise those source CO2eq values. The gas-mass option retains mixed native units and therefore requires an explicit characterization recipe and output unit.
Product IOT extensions#
The published extensions use industries, not products. To allocate them to
the model B IOT, explicitly set
extension_allocation="industry_technology" and supply the complete supply
table. MARIO divides each industry’s extension by its output, then allocates
flows to products through that industry’s supply. This is a derived extension
under the industry technology assumption, rather than a published product
account. Direct final-demand extensions retain their source values.
Allocation fails if an industry has nonzero extensions but zero supply output;
the parser does not discard those flows. Use the SUT or industry IOT, or read
the product IOT with extensions=False in that case.
The published 2015 bundle triggers this guard with all extension groups
selected. The native SUT and industry IOT retain those accounts unchanged.
Source and calculation scope#
The source year is 2015. Dates in the classification and metadata filenames refer to supporting-document revisions, not observation years. The files use CC BY 4.0; credit the JRC and the source authors and indicate changes. See the source methods paper for the construction and inventory boundaries.
The parser reads local files and keeps the complete inter-country scope.
Use calc_all=False for an initial import. Monetary flows are in million
EUR; use sufficient RAM for full dense economic blocks. A solve-based session
preset prefers optional UMFPACK and falls back to SciPy.
Leontief singularity#
The uncorrected industry IOT (model D), product IOT (model B), and
industry-based SUT system are singular in the published 2015 files.
The Irish industry E37T39_D (paper-waste incineration), or its product
CPA_E37T39_D, forms a closed production loop. In the product IOT its
output and intermediate self-use are both 0.004 million EUR, with no other
sales or final demand. Its own-input coefficient is exactly one. Changing
the numerical solver alone cannot invert that source system.
By default, the parser corrects only this verified isolated component:
IOT: reduce its own-input
Zcell by the selected epsilon fraction.SUT: reduce its own-input
Ucell; retainSunchanged.Retain the original output reference in
X(IOT) orXc(SUT), so normalization does not recreate a unit own-input coefficient.
With epsilon 1e-3, self-use changes from 0.004 to 0.003996 million EUR,
the own-input coefficient becomes 0.999, and its Leontief diagonal becomes
1,000. No other flow cell, ordinary zero diagonal, or database parser is
changed. The correction is skipped when the known nodes are absent or the
isolated source pattern no longer matches. It is not a general guarantee
against other singular components.
Inspect the warning and structured import report:
db.info["figaro_e3"]["diagonal_correction"]
For model="ModelState", the report is in
state.metadata.extra["figaro_e3"]["diagonal_correction"]. It records the
original and changed flow, epsilon, preserved output reference, accounting
gap and unchanged production satellite accounts. Absolute emissions, energy,
employment, value added and final demand are retained. Source files are not
edited.
This is an explicit numerical modelling assumption, not an official JRC correction or a reconstruction of unpublished values. Preserving output introduces a reported 0.000004 million EUR (4 EUR) balance gap at the default epsilon. It is not assigned to invented final demand or value added. The isolated node’s original production accounts, including 5.321 kt CO2eq in the checked four-gas inventory, remain outside native final-demand attribution. A complete inverse of the corrected system does not establish complete reconciliation with the source production inventory.
Epsilon controls the result: 1e-6 would give an own Leontief multiplier
of 1,000,000. Choose another finite epsilon strictly between zero and one
only with an explicit sensitivity analysis. To read exact uncorrected flows:
raw = mario.parse_figaro_e3(
path=root, table="SUT", diagonal_correction=None,
)
The uncorrected system still raises on a full inverse request. Independently determined partial multipliers can instead use the existing partial singular policy. The zero-output product-extension allocation limitation above remains separate.
The JRC construction code builds
and balances the economic tables; it does not calculate a Leontief inverse.
Its final export script rounds monetary
flows to three decimal places and also defines unrounded exports. Comparing
unrounded results could help diagnose lost small flows, but their invertibility
has not been established. The code’s EPS assignments preserve explicit
zeros for export (EpsOut=0), rather than regularizing I - z; see the
GAMS special-value definitions.
A partial result, pseudoinverse or successful import must not be presented as a full inverse of the uncorrected source system.
Full interfaces: parse_figaro_e3() and parse_figaro().