Skip to content

Port QEPro to ophyd-async and extract plans - #22

Open
Thomas Hopkins (thopkins32) wants to merge 3 commits into
mainfrom
qepro
Open

Thomas Hopkins (thopkins32) wants to merge 3 commits into
mainfrom
qepro

Conversation

@thopkins32

Copy link
Copy Markdown
Contributor

Assisted-by: oh-my-pi:gpt-5.6-terra

Summary

  • Replaced the classic Ophyd QEPro driver with an ophyd-async QEPro / QEProTEC implementation using declarative EPICS signals.
  • Preserved the QEPro PV contract, raw feature-bit API, async TEC setpoint completion, and acquisition completion on the COLLECT_RBV falling edge.
  • Added deterministic QEProMock behavior for local tests, including completed collection cycles without wall-clock sleeps.
  • Kept QEPro as a one-shot StandardReadable with structural trigger() semantics:
    • trigger returns immediately with an AsyncStatus
    • the status completes after acquisition finishes
    • the nine legacy event fields are freshly read after each completed trigger
    • no StandardDetector / fly / asset-provider lifecycle was introduced
  • Restricted normal event output to the legacy QEPro fields: x_axis, output, sample, dark, reference, spectrum_type, integration_time, num_spectra, and buff_capacity.
  • Added reusable QEPro-only plan primitives: configure_qepro, take_qepro_dark_frame, take_qepro_reference_frame, and set_qepro_temperature.
  • Expanded behavioral coverage for PV mapping, feature masks, trigger/TEC status boundaries, event/config field
    surfaces, frame restoration, and fresh post-trigger spectrum reads.

Motivation / Context

Will be helpful for testing acquisition workflows offline for the Blop optimization described in #14

Assisted-by: oh-my-pi:gpt-5.6-terra
Copilot AI balanced review requested due to automatic review settings September 30, 2026 21:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The configuration plan ignores requests to disable electric dark correction.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Ports QEPro support to ophyd-async and adds reusable Bluesky configuration and acquisition plans.

Changes:

  • Adds asynchronous QEPro/TEC devices with deterministic mock behavior.
  • Adds QEPro configuration, frame-capture, and temperature plans.
  • Adds behavioral tests and removes the obsolete PyEPICS development dependency.
File Description
src/​xpd_tools/​detectors/​qepro.py Implements QEPro devices and mocks.
src/​xpd_tools/​detectors/​__init__.py Exports QEPro classes.
src/​xpd_tools/​qepro_plans.py Adds reusable QEPro plans.
tests/​detectors/​test_qepro.py Tests device behavior and PV mappings.
tests/​test_qepro_plans.py Tests QEPro plans.
pyproject.toml Removes PyEPICS from development dependencies.
uv.lock Updates the resolved dependency set.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/xpd_tools/qepro_plans.py
Copilot AI balanced review requested due to automatic review settings September 30, 2026 21:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

EDC cannot be disabled through the configuration plan, and the lockfile conflicts with the declared development dependencies.

Review effort: Balanced
Findings: None

Resolved since last review (1)

Copilot AI balanced review requested due to automatic review settings September 30, 2026 21:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

Hardware-facing EPICS acquisition and TEC lifecycle behavior warrants final human review despite comprehensive mock coverage.

Review effort: Balanced
Findings: None

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