DiamondLightSource / DiamondLightSource/mx-bluesky

Simplify expected energy logic in mx-bluesky

Open
#1,792 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
4
Forks
5
Avg merge
1d 30m
Merged PRs (30d)
2

Description

Originally when `robot_load_then_centre` was called independently, we had to handle two cases:

* where the energy was not specified in the request and the desired energy was determined from the beamline state.
* where the energy was specified in the request and the beamline needed to be changed to this energy.

Because the detector params are computed up front this means that there is additional logic to populate the detector params in the first case by reading the beamline state.

Since we now don't call robot_load_then_centre as a standalone plan, we can potentially remove this logic. If it is ever needed again it would probably be better to put it in a beamline-specific plan wrapper.

## Acceptance Criteria
- This code is removed
- Tests still pass

Contributor guide

Open the contributing guide

Research direction

Start by locating robot_load_then_centre and tracing how detector parameters are populated when energy comes from beamline state. Remove the no-longer-needed standalone-plan logic, then run the test suite to confirm that all tests still pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.