Regions: EU27, RoW Sectors: Primary, Secondary, Tertiary, Energy + Cement One unique value added category (VA) and one consumption category per region

Packages installation#

It is suggested to create a specific environment where to install the required python packages. >conda create -n mario python=3.12

Install MARIO from the GitHub repository: download or syncronize to the dev_gtap_VA branch https://github.com/it-is-me-mario/MARIO/tree/dev_gtap_VA

Use the following instructions in the prompt window to install the correct version of MARIO: >cd your/path/of/the/MARIO/folder >pip install -e .

[ ]:
import mario

Read the aggregated version of GTAP12 (2 regions, 4 sectors, 1 consumption category, 1 value added category)

[ ]:
db_path= #your path to GTAP12_example_db.xlsx
db=mario.parse_from_excel(db_path,
                          table='IOT',
                          mode='flows')

Read the inventory file and disaggregate the tables

[ ]:
inventory_path= #your path to Inventory_toy.xlsx
db.read_add_sectors_excel(inventory_path,
                          split=True,
                          read_inventories=True)

cvxlab_path = #where you wish to have the disaggregation auxiliary folder located
split_db = db.add_sectors(inplace=False,split=True,
                    cvxlab_path=cvxlab_path,
                    parent_names={'Cement': 'Secondary_rest'},
                    solver='CLARABEL', #better MOSEK, free academic licence available
                    residue=1e-6) #Cells under 1 USD are considered 0

The enhanced GTAP database is contained in split, and can be explored

Z: Intersectoral transaction flows matrix

[ ]:
split.Z

Y: final domand matrix

[ ]:
split.Y

V: value added vector

[ ]:
split.V

Export the whole table to an excel file

[ ]:
desired_output_path= #where you wish to have the excel output file located
split.to_excel(desired_output_path)

Additional operations possible with MARIO, see documentation https://mario-suite.readthedocs.io/en/latest/index.html