Skip to content

Graph tab will not work when a processor is not found from an exchange. #1631

@tngTUDOR

Description

@tngTUDOR

What do you want to report?

In the following scenario, AB gets almost unresponsive, and the terminal keeps showing an error and makes AB almost unuseable when selecting the graph tab of a node (activity):

A project+database+activities+exchanges are created outside of AB (i.e.: only with brightway) and the user does not create a "production" edge with a product for a node.

The error is that the activity_browser.layouts.pages.activity_details.graph_tab function: get_processor_from_exchange naively returns processors[0], which in the in previous scenario is empty.

This does not happen when the activity is directly created with AB.

Relevant errors

IndexError: list index out of range
Error calling Python override of QTreeView::mouseDoubleClickEvent(): 09:36:14 | ERROR | IndexError: list index out of range
Traceback (most recent call last):
File "/home/loyaveun/mambaforge/envs/ab-sample/lib/python3.12/site-packages/activity_browser/layouts/panes/database_products.py", line 346, in mouseDoubleClickEvent
actions.ActivityOpen.run(self.selected_activities)
File "/home/loyaveun/mambaforge/envs/ab-sample/lib/python3.12/site-packages/activity_browser/actions/base.py", line 59, in wrapper
raise e
File "/home/loyaveun/mambaforge/envs/ab-sample/lib/python3.12/site-packages/activity_browser/actions/base.py", line 49, in wrapper
func(*args, **kwargs)
File "/home/loyaveun/mambaforge/envs/ab-sample/lib/python3.12/site-packages/activity_browser/actions/activity/activity_open.py", line 58, in run
page = pages.ActivityDetailsPage(act)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/loyaveun/mambaforge/envs/ab-sample/lib/python3.12/site-packages/activity_browser/layouts/pages/activity_details/activity_details.py", line 83, in __init__
self.sync()
File "/home/loyaveun/mambaforge/envs/ab-sample/lib/python3.12/site-packages/activity_browser/layouts/pages/activity_details/activity_details.py", line 168, in sync
self.graph_explorer.sync()
File "/home/loyaveun/mambaforge/envs/ab-sample/lib/python3.12/site-packages/activity_browser/layouts/pages/activity_details/graph_tab.py", line 74, in sync
json = self.build_json()
^^^^^^^^^^^^^^^^^
File "/home/loyaveun/mambaforge/envs/ab-sample/lib/python3.12/site-packages/activity_browser/layouts/pages/activity_details/graph_tab.py", line 111, in build_json
processor = get_processor_from_exchange(exc)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/loyaveun/mambaforge/envs/ab-sample/lib/python3.12/site-packages/activity_browser/layouts/pages/activity_details/graph_tab.py", line 189, in get_processor_from_exchange
processor = processors[0]
~~~~~~~~~~^^^
IndexError: list index out of range

Version

3.0.0b1163

Installation method

PyPI (pip)

Operating system

Linux
Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    betaIssues related to the Activity Browser 3 Beta

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions