activity-browser icon indicating copy to clipboard operation
activity-browser copied to clipboard

AB fails to calculate LCA results for an activity with only biosphere flows

Open bsteubing opened this issue 4 years ago • 1 comments

A calculation setup for JUST this activity fails: image

The error message is as follows, so this has something to do with how the dataframes behind this are built in the AB... it should be possible.

Traceback (most recent call last):
  File "C:\Users\steub\surfdrive\Leiden\python\GitHub\LCA-ActivityBrowser\activity-browser\activity_browser\layouts\tabs\LCA_results_tab.py", line 60, in generate_setup
    new_tab = LCAResultsSubTab(cs_name, presamples, self)
  File "C:\Users\steub\surfdrive\Leiden\python\GitHub\LCA-ActivityBrowser\activity-browser\activity_browser\layouts\tabs\LCA_results_tabs.py", line 105, in __init__
    ef=ElementaryFlowContributionTab(self),
  File "C:\Users\steub\surfdrive\Leiden\python\GitHub\LCA-ActivityBrowser\activity-browser\activity_browser\layouts\tabs\LCA_results_tabs.py", line 933, in __init__
    self.toggle_comparisons(self.switches.indexes.func)
  File "C:\Users\steub\surfdrive\Leiden\python\GitHub\LCA-ActivityBrowser\activity-browser\activity_browser\layouts\tabs\LCA_results_tabs.py", line 802, in toggle_comparisons
    self.update_tab()
  File "C:\Users\steub\surfdrive\Leiden\python\GitHub\LCA-ActivityBrowser\activity-browser\activity_browser\layouts\tabs\LCA_results_tabs.py", line 872, in update_tab
    self.set_combobox_changes()
  File "C:\Users\steub\surfdrive\Leiden\python\GitHub\LCA-ActivityBrowser\activity-browser\activity_browser\layouts\tabs\LCA_results_tabs.py", line 853, in set_combobox_changes
    self.df = self.update_dataframe(**compare_fields)
  File "C:\Users\steub\surfdrive\Leiden\python\GitHub\LCA-ActivityBrowser\activity-browser\activity_browser\layouts\tabs\LCA_results_tabs.py", line 942, in update_dataframe
    return self.parent.contributions.top_elementary_flow_contributions(
  File "C:\Users\steub\surfdrive\Leiden\python\GitHub\LCA-ActivityBrowser\activity-browser\activity_browser\bwutils\multilca.py", line 720, in top_elementary_flow_contributions
    labelled_df = self.get_labelled_contribution_dict(
  File "C:\Users\steub\surfdrive\Leiden\python\GitHub\LCA-ActivityBrowser\activity-browser\activity_browser\bwutils\multilca.py", line 518, in get_labelled_contribution_dict
    joined = self.join_df_with_metadata(
  File "C:\Users\steub\surfdrive\Leiden\python\GitHub\LCA-ActivityBrowser\activity-browser\activity_browser\bwutils\multilca.py", line 462, in join_df_with_metadata
    df.index = pd.MultiIndex.from_tuples(df.index)
  File "C:\Users\steub\miniconda3\envs\ab38\lib\site-packages\pandas\core\indexes\multi.py", line 202, in new_meth
    return meth(self_or_cls, *args, **kwargs)
  File "C:\Users\steub\miniconda3\envs\ab38\lib\site-packages\pandas\core\indexes\multi.py", line 547, in from_tuples
    raise TypeError("Cannot infer number of levels from empty list")
TypeError: Cannot infer number of levels from empty list

bsteubing avatar Nov 24 '21 15:11 bsteubing

In addition: I was helping someone and they found a related problem: AB fails when calculating reference flows with 1 exchange that is 0 with a very non-descript error: OSError: [WinError -1066598274] Windows Error 0xc06d007e image

marc-vdm avatar Apr 04 '22 07:04 marc-vdm

These errors are no longer present within the latest versions of the AB solving the issue raised here

Zoophobus avatar Jan 26 '23 13:01 Zoophobus