LCA-ActivityBrowser / activity-browser

GUI for brightway2
GNU Lesser General Public License v3.0
151 stars 57 forks source link

how to add biosphere flows to the database which is updated using Futura Tool and exported directly to brightway2 project #1012

Open zeeshankhan2 opened 1 year ago

zeeshankhan2 commented 1 year ago

hi, i am using FUTURA tool for changing the database electricity mixes. When i upload recipie to FUTURA and then i use the built-in function of export to brightway2,it eventually appears in the activity browser(ie de_apos_3.8_de_china_zero_coal_lignite) but the biosphere flows are not connected to it in the column Depends and hence results can't be get after running an activity in that database.I am struglling how to connect the biosphere flows to that updated database.I am sharing the screen shot below.

image

zeeshankhan2 commented 1 year ago

Thanks for the response. I tried to link the database using right click on the database and then click biosohere3 to be linked, but it did not worked out for me. Can you please guide how to fix that? unfortunately i am not very python friendly and would appreciate your guidance.

Zoophobus commented 1 year ago

Hi @zeeshankhan2

Before I get you to deal with the brightway code I'm going to ask you to use the AB again, however you'll need to wait for some updates to be released. Unfortunately, for yourself we forgot to add some signals to signify when the AB is busy on this relinking, I'm going to update this before asking you to continue.

The process of relinking the databases is quite intensive and for you this will first involve getting all of the keys from the biosphere3 database (making sure duplicates aren't present) then checking the exchanges in your database with the "old link" to this new list of activities from the biosphere3 database. This can take really quite a long time and will lock the AB (I haven't tried it for a database of 20k items, but I would leave it to do this, watching won't help and if there is a problem it will tell you).

zeeshankhan2 commented 1 year ago

Thanks a lot for the update,i updated the Ab and now when i try to relink the database to biosphere3 i still dont see the the status bar on user interface and get following in the conda prompt Loaded project: bw2io-0.8.7 Traceback (most recent call last): File "C:\Users\M. Zeeshan\anaconda3\envs\ab\lib\site-packages\activity_browser\controllers\database.py", line 143, in relink_database if failed > 0: UnboundLocalError: local variable 'failed' referenced before assignment

Is this issue already updated or i need to wait for this update to be seen in user interface of Ab. Thanks

Zoophobus commented 1 year ago

Sorry that this took so long, this change is up on the github version. I will make a release soon