Skip to content

Load algorithms from other packages through entry points - #57

Merged
seb5g merged 2 commits into
5.0.xfrom
feature/algorithm-entry-points
Oct 25, 2026
Merged

seb5g merged 2 commits into
5.0.xfrom
feature/algorithm-entry-points

Conversation

@seb5g

@seb5g seb5g commented Oct 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

Lets another package add algorithms to BeamShaping without being part of this repository (first user: the slmsuite hologram algorithms of pymodaq_plugins_slmsuite).

  • AlgorithmFactory only scanned pymodaq_plugins_beam_shaping.algorithms.algorithms. register_algorithms now also imports the modules declared in the entry point group pymodaq_plugins_beam_shaping.algorithms, after the built-in ones. Importing them runs their @AlgorithmFactory.register_algorithm() decorators.
  • A package that fails to import is logged as a warning and ignored, BeamShaping still starts.
  • Documented in the user guide (algorithms page).
  • Tests (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

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
seb5g merged commit 7e07f3c into 5.0.x Oct 25, 2026
7 checks passed
@seb5g
seb5g deleted the feature/algorithm-entry-points branch October 25, 2026 21:50
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.

2 participants