Add AggregatedStates and state machine#866
Open
cappel89 wants to merge 13 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds aggregated beamline state support to the BEC stack: a new AggregatedState model/evaluator in bec_lib, a client-facing BeamlineStateMachine loader, and a new scan intended to transition the beamline between aggregated-state labels.
Changes:
- Added aggregated state config/models and runtime evaluation logic in
bec_lib.bl_states. - Added a client-side
BeamlineStateMachineAPI and exposed it onBECClient. - Added a new server-side
_v4_state_transitionscan plus tests for aggregated-state/state-machine behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
bec_server/bec_server/scan_server/scans/state_transition_scan.py |
New v4 scan for moving devices/signals toward a target aggregated-state label. |
bec_lib/tests/test_beamline_states.py |
Expanded tests for aggregated states and the new state-machine loader/update API. |
bec_lib/bec_lib/client.py |
Exposes state_machine alongside beamline_states on the client. |
bec_lib/bec_lib/bl_states.py |
Adds aggregated-state config models, signal resolution, subscriptions, caching, and evaluation. |
bec_lib/bec_lib/bl_state_machine.py |
New helper for loading/updating aggregated state definitions from YAML or dicts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d-perl
reviewed
May 5, 2026
d-perl
reviewed
May 8, 2026
Contributor
d-perl
left a comment
There was a problem hiding this comment.
I think the concept is good, some comments in code
ab0e17c to
8dbb9e3
Compare
… fix and improve tests.
def9e20 to
fac5fc1
Compare
a929302 to
2a99e7a
Compare
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a new state: AggregatedStates, the state machine and a scan to move between labels of the aggregated scan. To test, use the config at the bottom.
A few remarks
Besides the two mentioned topics, the PR is ready to be merged. Simply use the config below, and follow the example to load it in the IPythonClient.
Assuming this config is stored under
state_config.yaml, you can now load it as follows#closes #831