pymrio
pymrio copied to clipboard
Structural Path Analysis tooling
It would be handy if pymrio included a tool for structural path analysis (SPA).
The proposal is to add this to pymrio.
New files
- pymrio/tools/iospa.py: main script for all SPA-related functions
- tests/test_spa.py: unit tests for all SPA-related functions
- doc/source/spa.rst: brief description of the SPA tool
- doc/source/notebooks/spa_examples.ipynb: Notebook with a few examples how to use the spa tooling.
Modified files:
- pymrio/core/mriosystem.py: add SPA function that allows the pymrio user to call the functions in pymrio/tools/iospa.py, with obligatory input the sector-regions that should be analysed and optional inputs that change the default settings of the computations for the SPA.
- doc/source/api_references.rst: Add SPA as tooling category and corresponding functions.
Fully agree that SPA would be very helpful tool to include in pymrio. I've thinking about it for a while. I have a C++ implementation of the SPA algorithm as proposed in Peters & Hertwich (2006) which you can call from R via Rcpp (https://github.com/simschul/PROSET_SDA). The code is very efficient, but still very messy, poorly documented and not thoroughly tested. Might be an option to use the C++ functions and call them from Python: https://realpython.com/python-bindings-overview/. I won't find any time to work on that code before September, but feel free to use it and contact me in case of questions.
FYI this library exists and implements SPA. I have made limited use of it, but it might suffice to include as another dependency in your project, @Beckebanze