Skip to content

Conversation

@bmaranville
Copy link
Member

This is needed for registering the serialized model migrations, as well as the specialized refl1d loader.

Currently the cli and webview interfaces start just fine without this PR, but older serialized models are not being migrated and therefore can't be opened.

This is needed for registering the serialized model migrations,
as well as the specialized refl1d loader
@bmaranville bmaranville requested a review from pkienzle May 23, 2025 18:27
from bumps.cli import install_plugin

CLIENT_PATH = Path(__file__).parent.parent / "client"
install_plugin(fitplugin)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels like we have two interfaces: bumps.cli.install_plugin and bumps.webview.server.cli.plugin_main. We should refactor bumps with the following in mind:

  • The old bumps.cli is deprecated
  • We may be moving bumps.webview.server.cli to bumps.cli.
  • We may be using the plugin without calling main, such as from a jupyter notebook.
  • The jupyter notebook may need app name, version and client path.

A possible solution is to define app_name, app_version and client_path in bumps.plugin and reference them from there in the cli and in webview.

A minimal 1.0 change is to move the install_plugin method out of bumps.cli. Maybe into bumps/__init__.py?

@bmaranville
Copy link
Member Author

I think it would be better to do #292 instead of this ...

@bmaranville bmaranville marked this pull request as draft May 30, 2025 13:36
@bmaranville
Copy link
Member Author

The work on refactoring the plugin infrastructure to use entry points is largely complete, but testing etc. has been put off until after bumps 1.0, so I think we should do this (extremely minimal) PR in order to get refl1d working in the meantime, as this is a bugfix.

@bmaranville bmaranville marked this pull request as ready for review June 9, 2025 20:49
@pkienzle pkienzle merged commit c03bb37 into master Jun 10, 2025
14 checks passed
@pkienzle pkienzle deleted the install-plugin-cli branch June 10, 2025 14:07
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.

3 participants