Adding parsing function for Exiobase 3.3.18 (hybrid) version #38
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I am requesting to merge these changes to main branch.
The changes implement a new parser function for exiobase database, in particular referring to version 3.3.18, downloadable at this link
In particular, the new feature have been implemented by updating the already present function parse_exiobase_sut, by adding the unit, version and extensions attributes.
The unit attribute can be selected among the _acceptable_units list, saved in the parserid.py file, and is by default set to "monetary". In the default case, the function is run exactly in the same way as the one in the main branch.
The version attribute is by default set to None and must be provided in case unit="hybrid"
The extensions attribute is by default set to None and can be provided as a list including any of the keys of the _acceptable_extensions dictionay saved in the parserid.py file.
Regarding the case when unit="hybrid", then the new hybrid_sut_parser function (in tableparser.py) will be invoked (see commit 799443f).
Initially, this function was developed to parse an old version of the database, downloadable from the official exiobase website, which was saved as a zip file. This version had supply, use and final demand matrices saved into separate .xlsb files therefore the parser was significantly slower than other ones for other exiobase versions.
The function was then modified in order to parse the database as the one available on zenodo (link reported previously), where the same matrices are available by default in .csv formats (much faster to be read).
Another improvement brought by this merge would be the fact that the aggregation excel file template obtained by the get_aggregation_excel function, automatically prints a new sheet showing the units of each entry of each set. This would ease the process of aggregation in case of hybrid databases.