Skip to content

Conversation

@EmsArnold
Copy link
Contributor

Closes #1498, and as an alternative to #1702. Scan syntax is more similar to both GDA and bluesky.

Wraps bluesky plans (scan, rel_scan, grid_scan, rel_grid_scan) and plan stubs (rd, stop) for use in blueapi. Intended as a replacement for gda-style start stop step scans until spec_scan is stable and supports start stop step rather than start stop num. Start stop step scans are achieved through generating a list for use with list_scan, rel_list_scan, ...

Concurrent trajectory scans (scan, etc.) and independent trajectory scans (grid_scan, etc.) are both accessed through the same plan and differentiated by number of parameters given for each movable - similar to current GDA-style scans.

Instructions to reviewer on how to test:

  1. Do thing x
  2. Confirm thing y happens

Checks for reviewer

  • Would the PR title make sense to a scientist on a set of release notes

@codecov
Copy link

codecov bot commented Nov 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.11%. Comparing base (8967593) to head (062f9fb).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1734      +/-   ##
==========================================
+ Coverage   99.09%   99.11%   +0.01%     
==========================================
  Files         276      277       +1     
  Lines       10151    10351     +200     
==========================================
+ Hits        10059    10259     +200     
  Misses         92       92              

☔ 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.

@EmsArnold EmsArnold force-pushed the wrap_plans_and_plan_stubs_with_dicts branch from 1cc044e to daeb4ec Compare November 25, 2025 13:34
@RJCD-Diamond
Copy link
Contributor

whatt else does this need until it can not be a draft and be merged?

@EmsArnold
Copy link
Contributor Author

@RJCD-Diamond, it should be good to go, but could likely use some input on plan names and and other changes.
Perhaps others (@olliesilvester, @noemifrisina, @DominicOram, @oliwenmandiamond, @fajinyuan) would have some opinions on this naming / scanning convention as opposed to the one laid out in #1702.

@EmsArnold EmsArnold marked this pull request as ready for review December 11, 2025 17:13
@EmsArnold EmsArnold requested a review from a team as a code owner December 11, 2025 17:13
@RJCD-Diamond
Copy link
Contributor

RJCD-Diamond commented Dec 11, 2025

Why did you go with num_scan when both gda and bluesky refer to this as scan? Are the behaviours different?

@EmsArnold
Copy link
Contributor Author

Why did you go with num_scan when both gda and bluesky refer to this as scan? Are the behaviours different?

scan in gda is a step scan, hence the distinction of both num_scan and step_scan, to make it more apparent for users coming from either bluesky or gda

Copy link
Contributor

@DominicOram DominicOram left a comment

Choose a reason for hiding this comment

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

until spec_scan is stable and supports start stop step rather than start stop num

Does this mean you intend for these to be removed when bluesky/scanspec#186 is done? If so I would put a comment in each plan you intend to retire saying that it will be replaced and pointing to that issue.

Concurrent trajectory scans (scan, etc.) and independent trajectory scans (grid_scan, etc.) are both accessed through the same plan and differentiated by number of parameters given for each movable - similar to current GDA-style scans.

Is this a hard requirement? I think I would rather we have them separate as:

On that note, having different behaviour based on whether we provide a num for each axis or not is also not intuitive. Again, I would just stick to the bluesky way of being more explicit about what you actually want to do

x_axis: Motor,
x_args: list[float | int],
):
run_engine(num_scan(detectors=[det], params={x_axis: x_args}))
Copy link
Contributor

Choose a reason for hiding this comment

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

Should: It would be good to assert something here e.g. that the motor is moved the expected number of times or that the detector is read the expected number of times. Otherwise this is just a smoke test. Similarly with other tests in this file.

params: Annotated[
dict[Movable | Motor, list[float | int]],
Field(
description="Dictionary of 'device: paramater' keys. For concurrent "
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit:

Suggested change
description="Dictionary of 'device: paramater' keys. For concurrent "
description="Dictionary of 'device: parameter' keys. For concurrent "

Copy link
Contributor

Choose a reason for hiding this comment

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

(Also in the rest of the file)

@RJCD-Diamond
Copy link
Contributor

RJCD-Diamond commented Dec 18, 2025

@EmsArnold Been using this for commissioning purposes on i22 - and strongly suggest we make sure that all of these plans stubs wait for the plan to finish by default

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.

Create wrapped versions of all standard bluesky plan and step_scan version of scan

4 participants