pymrio icon indicating copy to clipboard operation
pymrio copied to clipboard

Structural Path Analysis tooling

Open Beckebanze opened this issue 9 months ago • 2 comments

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.

Beckebanze avatar May 08 '24 09:05 Beckebanze

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.

simschul avatar Jun 03 '24 18:06 simschul

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

GroundhogState avatar Sep 11 '24 05:09 GroundhogState