Skip to content

create xopt agent wrapper class#58

Draft
roussel-ryan wants to merge 2 commits into
bluesky:mainfrom
roussel-ryan:main
Draft

create xopt agent wrapper class#58
roussel-ryan wants to merge 2 commits into
bluesky:mainfrom
roussel-ryan:main

Conversation

@roussel-ryan

@roussel-ryan roussel-ryan commented Sep 29, 2025

Copy link
Copy Markdown

Implements an agent wrapper class in bluesky-adaptive that enables the use of arbitrary Xopt (https://github.com/xopt-org/Xopt) generators in bluesky-adaptive runs.

Description

This pull request introduces a new module that wraps Xopt generators as agents compatible with the bluesky-adaptive framework. The new mixin class implements key abstract methods for decision-making, enabling integration of Xopt optimization workflows with bluesky-adaptive agents. Users are expected to implement experiment-specific details in subclasses.

Xopt generator agent integration:

  • Added XoptGeneratorBase class in bluesky_adaptive/agents/xopt.py to wrap Xopt Generator objects and implement generic agent logic, including data ingestion and suggestion of next steps. This class fulfills relevant abstract methods from the Agent base class, streamlining the integration of Xopt optimization strategies with bluesky-adaptive agents.

Documentation and structure:

  • Included module-level docstrings outlining the purpose of the mixin and specifying which experiment-specific methods need to be implemented by subclasses.

Motivation and Context

This change enables the use of Xopt-defined algorithms (v2.x.x) for bluesky adaptive runs.

Summary of Changes for Release Notes

Implements an agent wrapper class in bluesky-adaptive that enables the use of arbitrary Xopt (https://github.com/xopt-org/Xopt) generators in bluesky-adaptive runs.

Fixed

Added

Added /bluesky_adaptive/agents/xopt.py

Changed

Removed

How Has This Been Tested?

So far this has not been tested, pending discussion with maintainers.

@roussel-ryan

Copy link
Copy Markdown
Author

@pluflou how does this compare to your implementation at SLAC?

@pluflou

pluflou commented Sep 29, 2025

Copy link
Copy Markdown

@pluflou how does this compare to your implementation at SLAC?

At MFX, we've used Xopt directly only so far.

@checkmarx-gh-ast-us-povs

Copy link
Copy Markdown

Logo
Checkmarx One – Scan Summary & Detailsd270dbca-f898-48cd-9533-0e213547312a

Great job! No new security vulnerabilities introduced in this pull request


Communicate with Checkmarx by submitting a PR comment with @Checkmarx followed by one of the supported commands. Learn about the supported commands here.

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