Track optimization steps using event-model#236
Merged
thopkins32 merged 14 commits intomainfrom Feb 11, 2026
Merged
Conversation
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
Changed
blop.plans.optimizeto open a Bluesky run of its own to track suggestions and outcomes in the Blueksy event-model.Closes #220
Goals
Enable the use of Bluesky callbacks on each optimization step. Allows for live plots, writing to Tiled, etc.
Implications
Currently,
blop.plans.default_acquireopens a Bluesky run, since internally it is alist_scan. After this change, we have a nested run structure. For example,blop.plans.default_acquireis optional, and users can plug-in any acquisition plan they would like here, possibly opening/closing as many BlueskyRuns as they need.Forcing a flat run structure is not practical for the following reasons:
TiledWritercallbacks would require use with a batch size of 1 since Tiled is frequently use to fetch data and compute optimization outcomes.default_acquirelist_scanplan or stripping out the open/close run documents fromdefault_acquireCombining the entire optimization process into a single run is tempting since it can reduce the total number of UIDs needed to track. However, I'm not yet convinced that it is bad to have so many UIDs.
Follow-up changes
blop.protocols.EvaluationFunctionshould be more flexible. Instead of accepting auid: strit should accept a more generalrun_md: dictcontaining all metadata necessary to fetch the acquired data.blop.protocols.AcquisitionPlanmust in turn change to return arun_md: dictinstead of just auid: str.