Skip to content

Refactor common gridscan#1270

Merged
olliesilvester merged 6 commits into
mainfrom
refactor_common_gridscan_new
Sep 24, 2025
Merged

Refactor common gridscan#1270
olliesilvester merged 6 commits into
mainfrom
refactor_common_gridscan_new

Conversation

@olliesilvester

Copy link
Copy Markdown
Contributor

mx-bluesky side for DiamondLightSource/dodal#1479

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 user on a set of release notes

@olliesilvester olliesilvester requested a review from a team as a code owner September 15, 2025 15:19
@codecov

codecov Bot commented Sep 15, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.77778% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.15%. Comparing base (1aa4b5e) to head (5cdf5fb).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1270   +/-   ##
=======================================
  Coverage   90.15%   90.15%           
=======================================
  Files         130      130           
  Lines        7840     7844    +4     
=======================================
+ Hits         7068     7072    +4     
  Misses        772      772           
Components Coverage Δ
i24 SSX 75.27% <ø> (ø)
hyperion 97.79% <100.00%> (ø)
other 97.99% <97.50%> (+<0.01%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rtuck99 rtuck99 self-assigned this Sep 24, 2025
Comment thread src/mx_bluesky/common/parameters/gridscan.py Outdated
Comment thread src/mx_bluesky/common/parameters/gridscan.py
@rtuck99

rtuck99 commented Sep 24, 2025

Copy link
Copy Markdown
Contributor

There's nothing wrong with this PR as far as it goes, however I think we could make more changes, and possibly we should err on the side of doing them sooner rather than later, before more beamlines start using the current parameter model and make it harder to change things.

image

IMO GridCommon shouldn't be a subclass of MxBlueskyParameters since it means to use gridscans you have to either make your plan parameter a subclass of GridCommon or do some stupid parameter-stuffing gymnastics like in LoadCentreCollect.

Instead the grid parameters should be included by composition in the parent parameter object, and shouldn't include things like WithSample, WithOptionalEnergy etc.

See also

Also I think that there should just be one SpecifiedGridScan which just has a sequence of grids, 2D and 3D just become cases where the sequence has 1 or 2 grids. Although this would require some changes to other code, notably things like GridParamUpdate.

@rtuck99 rtuck99 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved although see additional comment for changes that are perhaps outside the immediate scope of this PR, but we should consider doing

@olliesilvester

Copy link
Copy Markdown
Contributor Author

I agree with your comments about the parameter model. SpecifiedGrid should be a component of a parameter model rather than a BaseModel which inherits from a bunch of other components

@olliesilvester olliesilvester merged commit 7767dad into main Sep 24, 2025
24 checks passed
@olliesilvester olliesilvester deleted the refactor_common_gridscan_new branch September 24, 2025 16:55
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