Skip to content

Use bluesky scan plans directly - #2289

Open
oliwenmandiamond wants to merge 20 commits into
pin_bluesky_shape_metadatafrom
scan_wrrapper
Open

oliwenmandiamond wants to merge 20 commits into
pin_bluesky_shape_metadatafrom
scan_wrrapper

Conversation

@oliwenmandiamond

@oliwenmandiamond oliwenmandiamond commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Fixes DiamondLightSource/sm-bluesky#475. Please note the change is about +800 lines / - 1600 lines. The lock file change of adding blueapi dev dependency makes the change look larger than it is.

Update dodal to use the bluesky scan plans directly. Blueapi now supports using the scan plans as they are now strongly typed, supports args kwargs, and doesn't throw error on unserialisable fields such as per step and per shot.

Scan plans are moved to their own folder and grouped appropriately to improve readability and more modular.

This wraps the bluesky plans to strip reference to the per step and per shot from the arguments and doc string as users cannot use it and will only confuse them.

I have refactored the step scans to be line with the bluesky plan style and simple to use for a user.

Small and simple blueapi integration tests also added.

Disclaimer: This has been assisted by AI.

Instructions to reviewer on how to test:

  1. Check implementation makes sense
  2. Tests pass

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}

@codecov

codecov Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (pin_bluesky_shape_metadata@bd2b9fa). Learn more about missing BASE report.

Additional details and impacted files
@@                      Coverage Diff                      @@
##             pin_bluesky_shape_metadata    #2289   +/-   ##
=============================================================
  Coverage                              ?   99.31%           
=============================================================
  Files                                 ?      384           
  Lines                                 ?    15090           
  Branches                              ?        0           
=============================================================
  Hits                                  ?    14987           
  Misses                                ?      103           
  Partials                              ?        0           

☔ View full report in Codecov by Harness.
📢 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.

@oliwenmandiamond
oliwenmandiamond changed the base branch from main to pin_bluesky_shape_metadata November 26, 2026 17:32
@oliwenmandiamond

Copy link
Copy Markdown
Contributor Author

This assumes bluesky/bluesky#2124 is merged and new release is done for bluesky, but please review and give feedback while we wait for that

@tpoliaw

tpoliaw commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Without looking at the diff

  • Update dodal to use the bluesky scan plans directly.
  • Scan plans are moved to their own folder
  • Wraps the bluesky plans
  • Refactored the step scans to be line with the bluesky plan style and simple to use for a user.
  • Small and simple blueapi integration tests.

This sounds a lot like several PRs. While a lot of the lines in the diff are from lock files and rearranging modules, if there are also changes to the moved lines it really helps to do it in multiple steps.

@oliwenmandiamond

oliwenmandiamond commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Without looking at the diff

* Update dodal to use the bluesky scan plans directly.

* Scan plans are moved to their own folder

* Wraps the bluesky plans

* Refactored the step scans to be line with the bluesky plan style and simple to use for a user.

* Small and simple blueapi integration tests.

This sounds a lot like several PRs. While a lot of the lines in the diff are from lock files and rearranging modules, if there are also changes to the moved lines it really helps to do it in multiple steps.

That is fair, I will try and break this down into multiple PR's then

  1. Move the plan and test locations into a specific scan plan folder
  2. Update to use scan plans directly
  3. Update step scans to be in line with bluesky style
  4. Add small blueapi integration test

This branch has not been deployed

No deployments
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