Skip to content

Refactor wrapped scan plans so they are flatter#2050

Draft
oliwenmandiamond wants to merge 11 commits intomainfrom
refactor_scans_so_they_are_flatter
Draft

Refactor wrapped scan plans so they are flatter#2050
oliwenmandiamond wants to merge 11 commits intomainfrom
refactor_scans_so_they_are_flatter

Conversation

@oliwenmandiamond
Copy link
Copy Markdown
Contributor

@oliwenmandiamond oliwenmandiamond commented May 7, 2026

This change aims to make the scan syntax much more user friendly. Some examples are show below:

Old syntax

from dodal.plans import wrapped as dpw
>>> RE(dpw.list_grid_scan([], [(x, [1, 5, 10, 50])]))
>>> RE(dpw.step_grid_scan([], [(x, [1, 10, 1]), (y, [1, 5, 1])]))

New syntax

>>> RE(dpw.list_grid_scan([], [x, [1, 5, 10, 50]]))
>>> RE(dpw.step_grid_scan([], [x, 1, 10, 1, y, 1, 5, 1]))
# Blueapi client example
>>> bc.plans.step_grid_scan([], [x, 1, 10, 1, y, 1, 5, 1])

When BlueAPI supports *args, we can simplifier this even further by removing another set of brackets:

>>> RE(dpw.step_grid_scan([], x, 1, 10, 1, y, 1, 5, 1))

or BlueAPI client equivalent

>>> bc.plans.step_grid_scan([], x, 1, 10, 1, y, 1, 5, 1)

Instructions to reviewer on how to test:

  1. Check implementation and logic is correct
  2. Test coverage is sufficient.

Checks for reviewer

  • Would the PR title make sense to a scientist on a set of release notes
  • If a new device has been added does it follow the standards
  • If changing the API for a pre-existing device, ensure that any beamlines using this device have updated their Bluesky plans accordingly
  • Have the connection tests for the relevant beamline(s) been run via dodal connect ${BEAMLINE}

@oliwenmandiamond oliwenmandiamond changed the title Refactor scans so they are flatter Refactor wrapped scan plans so they are flatter May 7, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.11%. Comparing base (0649293) to head (2c4587a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2050      +/-   ##
==========================================
- Coverage   99.11%   99.11%   -0.01%     
==========================================
  Files         327      327              
  Lines       12812    12800      -12     
==========================================
- Hits        12699    12687      -12     
  Misses        113      113              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant