API Reference
Analyzing database
|
Checks if a specific data_set in the database is balance or not |
|
Checks the productivity of the system |
Defines if a database is single region or multi-region |
|
checks if the database is hybrid or monetary |
|
Returns a list of levels of info in the model |
|
Returns all the scenarios existed in the model |
|
Returns the type of the database |
|
|
Returns a list or a DataFrame of different levels of indeces in the database. |
Database modification
|
This function is in charge of reading data regarding the aggregation |
|
Adds a Sector/Activity/Commodity to the database |
|
Extracts a single region from multi-region databases |
|
The function will transform a SUT table to a IOT table |
|
Adding a new extension [Factor of production or Satellite account] to the database passing the coefficients or the absolute values. |
|
Updates the matrices for a specific scenario. |
|
Deletes the coefficients of a scenario and keeps only flows |
|
Deletes the flows of a scenario and keeps only coefficients |
|
Creates a new scenario by cloning an existing scenario |
Returns a deepcopy of the instance |
|
The function creates a backup of the last configuration of database to be returned in case needed. |
|
This function is in charge of reseting back the database to the last back-up. |
Shock analysis
|
Implements shocks on different matrices with the possibility of defining clusters on every level of information. |
Data visualization
|
Sets the default palette of plots |
|
Plots sectoral GDP with additional info |
|
Creates bubble plots |
|
Plots linkages in different modes |
|
Generates a general html barplot giving the user certain degrees of freedom such as: |
Get excels
mario has some functions providing automatic excel file generations for easing some of the functionalities such as aggrgeaton and adding sectors.
|
Generates the Excel file for aggregation of the database |
|
Generates an Excel file for easing the add extension functionality |
|
Generates an Excel file to add a sector/activity/commodity to the database |
|
Creates an Excel file based on the shape and the format |
Save data
|
Saves the database into an Excel file |
|
Saves the database multiple text file based on given inputs |
|
Returns a pymrio.IOSystem from a mario.Database |
Database parsers
Structured Databases
mario supports automatic parsing of following database:
Exiobase
Eurostat Supply and Use
Eora26
Eora single region
|
Parsing exiobase3 |
|
Parsing exiobase mrsut |
|
Parsing Eurostat databases |
|
Parsing eora databases |
|
Parsing a pymrio database |
|
reads hybrid supply and use exiobase |
|
A unique function for parsing all exiobase databases |
Non-Structured Databases
When databases are not structured (coming from abovementioned sources), excel or text parsers can be used. The databases in this case, should follow specific rules:
|
Parsing database from excel file |
|
Parsing database from text files |
Calculations
High level matrix calculations
This function can be called inside a mario.Database object to call missing matrices for different scenarios.
|
Calculates the input-output matrices for different scenarios. |
|
Return the value of the GDP based scenario. |
|
Calculates the linkages in different modes |
Low level matrix calculations
This functions are used to calculate the matrices in mario.Database while they can be used independently outside a mario.Databases object.
|
Calculates the production vector |
|
Calculates Production vector from Leontief coefficients matrix |
|
Calculates Production vector from Intersectoral transaction coefficients matrix |
|
Calculates Intersectoral transaction flows matrix |
|
Calculates satellite transaction flows matrix |
|
Calculates Factor of production transaction flows matrix |
|
Calculates Economic impact matrix |
|
Calculates Footprint flows matrix |
|
Calculates Intersectoral transaction coefficients matrix |
|
Calculates Factor of production transaction coefficients matrix |
|
Calculates Satellite transaction coefficients matrix |
|
Calculates Multipliers coefficients matrix |
|
Calculates Footprint coefficients matrix |
|
Calculates Leontief coefficients matrix |
|
Calculates Ghosh coefficients matrix |
|
Calculates Intersectoral transaction direct-output coefficients matrix (for Ghosh model) |
|
Calculating Price index coefficients vector |
|
Calculates Final demand share coefficients matrix |
Metadata
|
Saves the metadata in different formats |
Returns the whole history of the metadata |
|
|
Adds notes to the meta history |
Test
For having a simple exmaple of mario, load_test can be used.
|
Loads an example of mario.Database |
Directory
When mario needs to save an output of the model, if no path is given, files wil be saved in a default directory with subfolders based on the type of the output. By default, the directory is the working directory but user can change the default directory.
The defualt directory of the database |
Utilities
There are some useful functions in mario that may help the user for different purposes.
|
Searches for specific keywords in a given item |
|
Helps to slice the matrices |
Logging
In case that logging is useful for the user, the following function can be used to set the level of verbosity.
|
Sets the formatted logging level |