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

Calculation will fail if no reference product is set #24

Open
1 task done
ughstudios opened this issue Jun 8, 2024 · 0 comments
Open
1 task done

Calculation will fail if no reference product is set #24

ughstudios opened this issue Jun 8, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ughstudios
Copy link

Updating AB

  • Yes, I have updated AB and still experience this issue

What happened?

The code tries to access a value named "reference product" when performing a calculation. However, that value may not always be set.

Relevant errors

ERROR  Traceback (most recent call last):   File "/Users/danielgleason/Desktop/cauldron_activity_browser/activity-browser/activity_browser/bwutils/calculations.py", line 24, in do_LCA_calculations     mlca = MLCA(cs_name)   File "/Users/danielgleason/Desktop/cauldron_activity_browser/activity-browser/activity_browser/bwutils/multilca.py", line 196, in __init__     f'{act["reference product"]} | '   File "/opt/homebrew/Caskroom/miniconda/base/envs/ab/lib/python3.10/site-packages/bw2data/backends/proxies.py", line 235, in __getitem__     raise KeyError KeyError  During handling of the above exception, another exception occurred:  Traceback (most recent call last):   File "/Users/danielgleason/Desktop/cauldron_activity_browser/activity-browser/activity_browser/layouts/tabs/LCA_results_tab.py", line 58, in generate_setup     new_tab = LCAResultsSubTab(data, self)   File "/Users/danielgleason/Desktop/cauldron_activity_browser/activity-browser/activity_browser/layouts/tabs/LCA_results_tabs.py", line 137, in __init__     self.mlca, self.contributions, self.mc = calculations.do_LCA_calculations(data)   File "/Users/danielgleason/Desktop/cauldron_activity_browser/activity-browser/activity_browser/bwutils/calculations.py", line 27, in do_LCA_calculations     raise BW2CalcError("LCA Failed", str(e)).with_traceback(e.__traceback__)   File "/Users/danielgleason/Desktop/cauldron_activity_browser/activity-browser/activity_browser/bwutils/calculations.py", line 24, in do_LCA_calculations     mlca = MLCA(cs_name)   File "/Users/danielgleason/Desktop/cauldron_activity_browser/activity-browser/activity_browser/bwutils/multilca.py", line 196, in __init__     f'{act["reference product"]} | '   File "/opt/homebrew/Caskroom/miniconda/base/envs/ab/lib/python3.10/site-packages/bw2data/backends/proxies.py", line 235, in __getitem__     raise KeyError bw2calc.errors.BW2CalcError: ('LCA Failed', '')

Operating system

MacOS

Conda environment

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant