Skip to content

Migrate to the plugin template layout, use thorlabs' Elliptec, rewrite the extension - #1

Merged
seb5g merged 5 commits into
mainfrom
feature/plugin_acceptance_tests
Oct 13, 2026
Merged

seb5g merged 5 commits into
mainfrom
feature/plugin_acceptance_tests

Conversation

@seb5g

@seb5g seb5g commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Before: the plugin was packaged with setup.py, MANIFEST.in and plugin_info.toml, shipped its own (older) copy of the Elliptec actuator, and its FTIR_JM extension was a PyMoDAQ 4 CustomApp started from a preset.

After: it has the layout of the current plugin template, gets the Elliptec actuator from pymodaq_plugins_thorlabs, and the FTIR_JM extension is a CustomExt that works with the Dashboard's experiments; two experiments replace the old preset.

What changes:

  • Packaging: pyproject.toml (hatch, version from git tags, classifiers computed at build from [tool.pymodaq]) replaces setup.py, MANIFEST.in and plugin_info.toml; shared CI workflows of the template; acceptance tests from pymodaq.utils.plugin_testing; AGENTS.md / CLAUDE.md. Leftovers of the old template removed (root __init__.py, PID model template).
  • Elliptec: daq_move_Elliptec.py is removed and pymodaq_plugins_thorlabs>=5.3.0 is a dependency. Both files descend from the same plugin; the thorlabs one is the PyMoDAQ 5 version (degree units, current_value, master/slave handling). Keeping both would give two actuators named Elliptec, and PyMoDAQ takes the first one found (find_dict_in_list_from_key_val in pymodaq/control_modules/instruments.py).
  • pymodaq_plugins_raspberry (PiCamera, needs picamera2) is installed on aarch64/armv7l only, so the package installs on CI runners and PCs.
  • Extension: derives from CustomExt like the template (create_dashboard_toolbar, do_things_after_experiment_set, main() with load_dashboard_with_arguments / create_extension). Instrument names and the two target positions are read from the plugin configuration through GlobalConfig.
  • Experiments: resources/FTIR_JM.xml (Elliptec + PiCamera) and resources/FTIR_JM_mock.xml (Mock plugins), created with PyMoDAQ 5.3's ExperimentManager parameters and copied into the experiment folder by main().

How tested: with pymodaq 5.3.5 and PyQt5, pytest (2 passed, 2 skipped: no instrument plugin left) and check_plugin pass, the wheel's metadata and entry points were checked, and the extension was run headless on FTIR_JM_mock: the experiment loads, Snap shows the image and Move Abs moves the actuator. Nothing was run against the real hardware (Elliptec, PiCamera, Raspberry Pi).

🤖 Generated with Claude Code

https://claude.ai/code/session_0133Ko33t5rFAg2uX8hVMgZs

- pyproject.toml + hatch_build.py replace setup.py, MANIFEST.in and plugin_info.toml
  (entry points are generated from the [features] table, version comes from git tags)
- tests/test_plugin_package_structure.py: acceptance checks from pymodaq.utils.plugin_testing
- .github/workflows: tests, compatibility and publish call the shared workflows of
  PyMoDAQ/pymodaq_plugins_template (legacy Test.yml/Testbase.yml removed)
- AGENTS.md / CLAUDE.md for AI coding assistants

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tdiso1u1ZhikSutj2Qs5Cg
The shared tests and the template target pymodaq>=5.3.2 (pymodaq_utils>=5.3.1, pymodaq_gui and pymodaq_data>=5.3.0), so releases of this plugin cannot be installed next to an older PyMoDAQ.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tdiso1u1ZhikSutj2Qs5Cg
…n of thorlabs

- pyproject: classifiers computed at build ([tool.pymodaq]), build requirement pymodaq_utils>=5.3.6
- the Elliptec actuator now comes from pymodaq_plugins_thorlabs (its copy here was an older
  version with the same plugin name, so PyMoDAQ would pick one of the two)
- pymodaq_plugins_raspberry (PiCamera, needs picamera2) is installed on aarch64/armv7l only
- remove leftovers of the old template (root __init__.py, PID model template)
- AGENTS.md, .gitignore, __init__.py and utils.py as in the template

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0133Ko33t5rFAg2uX8hVMgZs
- the extension derives from CustomExt, as the template one: the Dashboard toolbar loads
  experiments and states, instruments are looked up by name after each experiment is set
- the old preset is replaced by two experiments: FTIR_JM (Elliptec + PiCamera) and
  FTIR_JM_mock (Mock plugins), copied in the experiment folder by main()
- module names and positions come from the plugin configuration, read through GlobalConfig
- README describes the extension

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0133Ko33t5rFAg2uX8hVMgZs
@seb5g seb5g changed the title Migrate packaging to pyproject and add the shared plugin tests Migrate to the plugin template layout, use thorlabs' Elliptec, rewrite the extension Oct 13, 2026
Every plugin declares the pymodaq.plugins entry point, read by get_instrument_plugins,
so the Config of utils.py is registered even without instrument plugins.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0133Ko33t5rFAg2uX8hVMgZs
@seb5g
seb5g merged commit 235c364 into main Oct 13, 2026
7 checks passed
@seb5g
seb5g deleted the feature/plugin_acceptance_tests branch October 13, 2026 19:41
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