Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Structural Path Analysis tooling #141

Open
Beckebanze opened this issue May 8, 2024 · 2 comments
Open

Structural Path Analysis tooling #141

Beckebanze opened this issue May 8, 2024 · 2 comments

Comments

@Beckebanze
Copy link
Contributor

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.
@simschul
Copy link
Member

simschul commented Jun 3, 2024

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.

@GroundhogState
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants