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

Make ScenarioLink AB=2.10 compatible #41

Merged
merged 5 commits into from
Aug 26, 2024
Merged

Make ScenarioLink AB=2.10 compatible #41

merged 5 commits into from
Aug 26, 2024

Conversation

marc-vdm
Copy link
Member

  • Fix compatibility issues with AB
  • Set minimum AB version of 2.10.1
    • This should allow older versions of SL to still be installed with older AB versions
    • AB 2.10.1 is not released yet but once released, this version should install when the correct version of AB is available
  • Replace all prints with AB logger
  • Standardize all string quotes to " for consistency
  • Log error handling with plugin version retrieval

@marc-vdm marc-vdm requested a review from romainsacchi July 19, 2024 11:36
@marc-vdm
Copy link
Member Author

You can already try the plugin with the dev version of AB, which tracks main:
conda create -n sl -c conda-forge -c bsteubing -c romainsacchi activity-browser-dev ab-plugin-scenariolink

@marc-vdm
Copy link
Member Author

Ah I see we will fail the tests until 2.10.1 is out, makes sense. It's holidays here now so it will be a few weeks, but after that we will release 2.10.1 and I'll let you know here!

@marc-vdm marc-vdm linked an issue Jul 19, 2024 that may be closed by this pull request
@cuadragg
Copy link

Hi!

I have the 2.10.1 version of AB and 3.9.1 version of ecoinvent and I was facing the same compatibility issues as you can see below:

(ab) PS C:\Users\cuadragg> conda activate sl
(sl) PS C:\Users\cuadragg> conda activate ab
(ab) PS C:\Users\cuadragg> activity-browser
09:55:47 | INFO | Activity Browser version: 2.10.1

DevTools listening on ws://127.0.0.1:3999/devtools/browser/de25d9bb-4f00-43bc-8f37-ce7c14fcfdf6
09:55:48 | INFO | Brightway2 data directory: C:\Users\cuadragg\AppData\Local\pylca\Brightway3
09:55:48 | INFO | Brightway2 current project: default
09:55:48 | INFO | Project settings directory: C:\Users\cuadragg\AppData\Local\pylca\Brightway3\default.c21f969b5f03d33d43e04f8f136e7682
09:55:48 | WARNING | Failed to load plugin 'ab_plugin_scenariolink' due to an error in the plugin, ignoring plugin. If this keeps happening contact the plugin developers and let them know of this error:
'FoldsTable' object has no attribute 'custom_view_sizing'
Remote debugging server started successfully. Try pointing a Chromium-based browser to http://127.0.0.1:3999

I also tried this approach: conda create -n sl -c conda-forge -c bsteubing -c romainsacchi activity-browser-dev ab-plugin-scenariolink, but it did not work or perparphs I did not do the correct procedure. Could someone please advise me on this?

I do appreciate the help
Thanks,
Glenda

@marc-vdm marc-vdm linked an issue Aug 26, 2024 that may be closed by this pull request
@marc-vdm

This comment was marked as outdated.

@marc-vdm
Copy link
Member Author

@romainsacchi this is now finally ready for your review :)

Once merged just push a new tag to main (#43) and we should be compatible with AB 2.10.1 and newer again.

@romainsacchi romainsacchi merged commit 48e6b16 into main Aug 26, 2024
@romainsacchi
Copy link
Collaborator

Thanks @marc-vdm

@caaficus
Copy link

Hi!

Is the fix fully implemented? I tried to check if the plugin works, but I couldn't manage. Here is the error

(ab) C:\>activity-browser
Import of plugin 'ab_plugin_scenariolink' failed: unterminated string literal (detected at line 202) (right.py, line 202)
08:47:33 | INFO | Activity Browser version: 2.10.1

DevTools listening on ws://127.0.0.1:3999/devtools/browser/f5ddbd8c-5d39-4e13-a982-f07edcdce4a6
08:47:34 | INFO | Brightway2 data directory: C:\Users\garci110\AppData\Local\pylca\Brightway3
08:47:34 | INFO | Brightway2 current project: default
08:47:35 | INFO | Project settings directory: C:\Users\garci110\AppData\Local\pylca\Brightway3\default.c21f969b5f03d33d43e04f8f136e7682
08:47:35 | ERROR | AttributeError: 'NoneType' object has no attribute 'infos'
Traceback (most recent call last):
  File "C:\Users\garci110\AppData\Local\miniconda3\envs\ab\Lib\site-packages\activity_browser\controllers\plugin.py", line 85, in reload_plugins
    self.close_plugin_tabs(self.plugins[name])
  File "C:\Users\garci110\AppData\Local\miniconda3\envs\ab\Lib\site-packages\activity_browser\controllers\plugin.py", line 79, in close_plugin_tabs
    panel.close_tab_by_tab_name(plugin.infos["name"])
                                ^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'infos'
Remote debugging server started successfully. Try pointing a Chromium-based browser to http://127.0.0.1:3999

@romainsacchi
Copy link
Collaborator

Hi @caaficus, does your environment have ab-plugin-scenariolink 0.0.9?

@caaficus
Copy link

Hi @romainsacchi - yes, I updated before launching AB

The following packages will be UPDATED:

  ab-plugin-scenari~                             0.0.8-py_0 --> 0.0.9-py_0
  openssl                                  3.3.1-h2466b09_2 --> 3.3.1-h2466b09_3

@romainsacchi
Copy link
Collaborator

@marc-vdm I confirm I have the same error (ab 2.10.1, ab_plugin_scenariolink 0.0.9).

@marc-vdm
Copy link
Member Author

@caaficus @romainsacchi Yup still seems there's a problem, looking in to it. Sorry about that 😅

@romainsacchi
Copy link
Collaborator

ab_plugin_scenariolink 0.1.1 works fine now, thanks @marc-vdm

@marc-vdm
Copy link
Member Author

@caaficus The newest version should be working now :)

@caaficus
Copy link

It works! Thanks @marc-vdm and @romainsacchi! Beautiful work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Plugin incompatibility with version 2.10.1 Activity-Browser 2.10 will likely break plugin
4 participants