Repository navigation
Load algorithms from other packages through entry points - #57
Merged
Merged
Conversation
Packages declaring a module in the pymodaq_plugins_beam_shaping.algorithms entry point group get it imported at startup, so the algorithms registered with AlgorithmFactory appear in the extension. A module failing to import is logged and ignored. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CAhZwmbyCSpSgfTyicUxuS
seb5g
marked this pull request as ready for review
October 25, 2026 21:39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lets another package add algorithms to BeamShaping without being part of this repository (first user: the slmsuite hologram algorithms of
pymodaq_plugins_slmsuite).AlgorithmFactoryonly scannedpymodaq_plugins_beam_shaping.algorithms.algorithms.register_algorithmsnow also imports the modules declared in the entry point grouppymodaq_plugins_beam_shaping.algorithms, after the built-in ones. Importing them runs their@AlgorithmFactory.register_algorithm()decorators.tests/algorithm_entry_points_test.py) use fake entry points: registration, group name, a broken package not blocking the others.Not covered
No real third party package was installed to test the discovery: the entry point loading is tested with fakes. The end-to-end check will be done with
pymodaq_plugins_slmsuite(phase 2).Generated by Claude Code