LCA-ActivityBrowser / activity-browser

GUI for brightway2
GNU Lesser General Public License v3.0
152 stars 58 forks source link

Few ideas for improvements: LCA Setup / contribution analysis #301

Closed KarinTreyer closed 3 years ago

KarinTreyer commented 5 years ago

Hi, I am using activity browser quite regularly as support of my work because I am still learning python/BW2 and very much appreciate the possibility to quickly visualise my data in AB.

Just few functionalities I am missing: 1) LCA Setup: Here it would be great if I could re-order the products and amounts / LCIA Methods by dragging them to another place. 2) Contribution analysis: Would be nice if I could see the contributions of all activities/biosphere flows of my production activity (=contribution of all foreground processes in my activity, level 1). We have a piece of code doing that calculation in a notebook in case you are interested, but we couldn't speed it up yet (it takes hours at the moment to do that calculation if many activities&LCIA methods (e.g. 32:17) are involved, but Chris gave us some inputs on how to speed up).

The next level of wish would then be that I would be able to do 1) transversal contribution analysis, e.g. extract the contribution of all electricity / transport related activities, or 2) being able to choose contributions of activities few levels below the activity of interest. Example: electricity production, solar thermal parabolic trough, 50 MW (=level 1) --> this has an input of CSP plant ("concentrated solar power plant, solar thermal parabolic trough, 50 MW") & few maintenance things like water for cleaning (= level 2) --> CSP plant = collector field, heat transport fluid system, thermal storage system, power block etc. (=level 3) So when looking at the results for electricity from CSP, I want to know what the contributions of the individual parts of the CSP plant are (level 3) as well as the maintenance inputs (level 2). Also here there's some code around from Chris...

Thanks in any case for the VERY helpful activity browser! Karin

dgdekoning commented 5 years ago

Hey Karin,

Good to hear you're happy with AB so far and thanks for the suggestions! Following are my thoughts on how simple/difficult your improvements are:

Just few functionalities I am missing:

  1. Very good point and something I noted recently as well, in theory should only require messing with the DragDropMode for the tables in LCA_setup.py to add the InternalMove functionality, though we'd have to take care not to overwrite other rows when dropping.
  2. This does sound nice to have, but as you noted, it would have to be a completely new piece of code (which gives the user a warning of dramatically increasing calculation time). If you have the time I would welcome your contribution (heh). The code used to perform contribution analysis starts here.

The next level of wish would then be that I would be able to do

  1. While this does seem like a handy thing to have, it requires implementing a way of determining which processes/activities are of a certain type (in this case, electricity- or transport related). This means either adding a specific field to those activities in the underlying brightway database or handling this in the MetaDataStore code (which stores data from the databases during a session).
  2. This sounds somewhat similar to the 2nd missing functionality above. Where in this case you allow the user to make a selection of exchanges of the activity (instead of using everything) that should be further explored (ie. additional LCA/contribution analysis).

I welcome shared notebooks or code from Chris and if you want to implement some of these things yourself I can definitely help!

StpdFox commented 3 years ago
  1. LCA Setup: Here it would be great if I could re-order the products and amounts / LCIA Methods by dragging them to another place.

  2. Contribution analysis: Would be nice if I could see the contributions of all activities/biosphere flows of my production activity (=contribution of all foreground processes in my activity, level 1). We have a piece of code doing that calculation in a notebook in case you are interested, but we couldn't speed it up yet (it takes hours at the moment to do that calculation if many activities&LCIA methods (e.g. 32:17) are involved, but Chris gave us some inputs on how to speed up).

Making these two seperate enhancement 'issues'. to be further refined and discussed https://github.com/LCA-ActivityBrowser/activity-browser/issues/571 and https://github.com/LCA-ActivityBrowser/activity-browser/issues/572 as possible improvements

If you have any input please comment on the newly created issues, or if there's anything unrelated the first two make a new issues :)