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

EF Contribution Analysis > Aggregate by Categories broken #1385

Open
1 task done
marc-vdm opened this issue Sep 30, 2024 · 0 comments
Open
1 task done

EF Contribution Analysis > Aggregate by Categories broken #1385

marc-vdm opened this issue Sep 30, 2024 · 0 comments
Labels
bug Issues/PRs related to bugs

Comments

@marc-vdm
Copy link
Member

Updating AB

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

What happened?

EF Contribution Analysis aggregation by Categories is broken.

Relevant errors

16:21:06 | INFO | Created LCA object
16:21:06 | INFO | Switching LCIA method
16:21:06 | INFO | Switching LCIA method
16:21:06 | INFO | Redoing LCI
16:21:06 | INFO | Redoing LCI
16:21:06 | INFO | Created LCA object
16:21:07 | INFO | +showing tab: LCA results
16:21:17 | ERROR | IndexError: tuple index out of range
Traceback (most recent call last):
  File "/home/marc/.conda/envs/abdev/lib/python3.11/site-packages/activity_browser/layouts/tabs/LCA_results_tabs.py", line 1029, in update_tab
    self.set_combobox_changes()
  File "/home/marc/.conda/envs/abdev/lib/python3.11/site-packages/activity_browser/layouts/tabs/LCA_results_tabs.py", line 1016, in set_combobox_changes
    self.df = self.update_dataframe(**compare_fields)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/marc/.conda/envs/abdev/lib/python3.11/site-packages/activity_browser/layouts/tabs/LCA_results_tabs.py", line 1100, in update_dataframe
    return self.parent.contributions.top_elementary_flow_contributions(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/marc/.conda/envs/abdev/lib/python3.11/site-packages/activity_browser/bwutils/multilca.py", line 835, in top_elementary_flow_contributions
    labelled_df = self.get_labelled_contribution_dict(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/marc/.conda/envs/abdev/lib/python3.11/site-packages/activity_browser/bwutils/multilca.py", line 592, in get_labelled_contribution_dict
    df.loc[df.index.difference(special_keys)]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/marc/.conda/envs/abdev/lib/python3.11/site-packages/pandas/core/indexes/base.py", line 3661, in difference
    result = self._difference(other, sort=sort)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/marc/.conda/envs/abdev/lib/python3.11/site-packages/pandas/core/indexes/base.py", line 3670, in _difference
    the_diff = this[other.get_indexer_for(this) == -1]
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/marc/.conda/envs/abdev/lib/python3.11/site-packages/pandas/core/indexes/base.py", line 6182, in get_indexer_for
    return self.get_indexer(target)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/marc/.conda/envs/abdev/lib/python3.11/site-packages/pandas/core/indexes/base.py", line 3932, in get_indexer
    pself, ptarget = self._maybe_downcast_for_indexing(target)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/marc/.conda/envs/abdev/lib/python3.11/site-packages/pandas/core/indexes/base.py", line 6359, in _maybe_downcast_for_indexing
    other = type(self).from_tuples(other)  # type: ignore[attr-defined]
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/marc/.conda/envs/abdev/lib/python3.11/site-packages/pandas/core/indexes/multi.py", line 222, in new_meth
    return meth(self_or_cls, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/marc/.conda/envs/abdev/lib/python3.11/site-packages/pandas/core/indexes/multi.py", line 617, in from_tuples
    arrays = list(lib.tuples_to_object_array(tuples).T)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "lib.pyx", line 3041, in pandas._libs.lib.tuples_to_object_array
IndexError: tuple index out of range

Operating system

Linux/Other (please specify above)

Conda environment

No response

@marc-vdm marc-vdm added the bug Issues/PRs related to bugs label Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues/PRs related to bugs
Projects
None yet
Development

No branches or pull requests

1 participant