Skip to content

Feature/scan bundler device progress#893

Draft
wakonig wants to merge 1 commit into
mainfrom
feature/scan_bundler_device_progress
Draft

Feature/scan bundler device progress#893
wakonig wants to merge 1 commit into
mainfrom
feature/scan_bundler_device_progress

Conversation

@wakonig
Copy link
Copy Markdown
Member

@wakonig wakonig commented May 16, 2026

Description

This PR merges the scan progress update for monitored readouts and device progress into a single update for "scan progress". The scan bundler now automatically subscribes to the device for the scan and forwards the update accordingly.

Related Issues

How to test

  • Run unit tests
  • Run a scan with device progress and one with normal monitored progress. Check the plugin repo for a scan with device progress.

Additional Comments

Once merged, we can simplify the subscription logic in BW.

@wakonig wakonig force-pushed the feature/scan_bundler_device_progress branch from de4faef to 067ee2e Compare May 16, 2026 11:42
@codecov
Copy link
Copy Markdown

codecov Bot commented May 16, 2026

Codecov Report

❌ Patch coverage is 71.95122% with 23 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
bec_server/bec_server/scan_bundler/scan_bundler.py 27.27% 16 Missing ⚠️
bec_server/bec_server/scan_bundler/bec_emitter.py 88.33% 2 Missing and 5 partials ⚠️

📢 Thoughts on this report? Let us know!

@wakonig wakonig force-pushed the feature/scan_bundler_device_progress branch 3 times, most recently from 2b9ad1b to f9c5462 Compare May 29, 2026 12:39
@wakonig wakonig marked this pull request as ready for review June 1, 2026 09:19
Copilot AI review requested due to automatic review settings June 1, 2026 09:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for reporting scan progress based on a device’s progress signal (via scan queue report_instructions), instead of always deriving progress from emitted scan points. It wires scan-queue-status handling into the ScanBundler and extends the BECEmitter to subscribe/unsubscribe to device progress topics and emit scan progress accordingly.

Changes:

  • Subscribe ScanBundler to scan_queue_status and extract per-scan report_instructions into scan_report_instructions.
  • Update BECEmitter to optionally subscribe to device_progress/<device> and use that to emit scan progress (including cleanup/unsubscribe paths).
  • Extend scan bundler emitter tests to cover device-progress subscription behavior and cleanup.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
bec_server/bec_server/scan_bundler/scan_bundler.py Track scan report instructions from scan queue status updates; trigger emitter cleanup earlier in storage cleanup.
bec_server/bec_server/scan_bundler/bec_emitter.py Add device-progress-based scan progress reporting, subscription management, and last-progress emission on completion.
bec_server/tests/tests_scan_bundler/test_bec_emitter.py Add/adjust unit tests covering device-progress subscriptions and scan progress emission behavior.
Comments suppressed due to low confidence (2)

bec_server/bec_server/scan_bundler/scan_bundler.py:400

  • scan_report_instructions is stored per scan id but never removed during cleanup. This can accumulate stale entries and leak memory across scans. Include it in the cleanup storages list.
            for storage in [
                "sync_storage",
                "monitored_devices",
                "baseline_devices",
                "readout_priority",
            ]:

bec_server/bec_server/scan_bundler/scan_bundler.py:400

  • scan_report_instructions is stored per scan id but never removed during cleanup. This can accumulate stale entries and leak memory across scans. Include it in the cleanup storages list.
            for storage in [
                "sync_storage",
                "monitored_devices",
                "baseline_devices",
                "readout_priority",
            ]:

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread bec_server/bec_server/scan_bundler/bec_emitter.py
Comment thread bec_server/bec_server/scan_bundler/scan_bundler.py
Comment thread bec_server/bec_server/scan_bundler/bec_emitter.py
Comment thread bec_server/bec_server/scan_bundler/scan_bundler.py
Comment thread bec_server/tests/tests_scan_bundler/test_bec_emitter.py
@wakonig wakonig marked this pull request as draft June 1, 2026 09:26
@wakonig wakonig force-pushed the feature/scan_bundler_device_progress branch from f9c5462 to 2c41676 Compare June 1, 2026 09:37
@wakonig wakonig self-assigned this Jun 1, 2026
@wakonig wakonig force-pushed the feature/scan_bundler_device_progress branch from 2c41676 to 6357099 Compare June 1, 2026 12: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.

2 participants