Skip to content

Conversation

@RJCD-Diamond
Copy link
Contributor

@RJCD-Diamond RJCD-Diamond commented Nov 28, 2025

The client that exists in blueapi is functional. This class extends the ability of the client, abstracts a lot of the logic and allows beamline staff or users to start building scripts used for an experiment.

@RJCD-Diamond RJCD-Diamond requested a review from a team as a code owner November 28, 2025 14:38
@RJCD-Diamond
Copy link
Contributor Author

@EmsArnold

@RJCD-Diamond RJCD-Diamond changed the title Add a UserClient that can be used a scripting interface for blueapi feat: Add a UserClient that can be used a scripting interface for blueapi Nov 28, 2025
@codecov
Copy link

codecov bot commented Nov 28, 2025

Codecov Report

❌ Patch coverage is 89.56522% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.69%. Comparing base (d8a989c) to head (266aaa0).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/blueapi/client/user_client.py 88.78% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1284      +/-   ##
==========================================
- Coverage   94.92%   94.69%   -0.23%     
==========================================
  Files          42       43       +1     
  Lines        2717     2828     +111     
==========================================
+ Hits         2579     2678      +99     
- Misses        138      150      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@RJCD-Diamond
Copy link
Contributor Author

RJCD-Diamond commented Nov 28, 2025

@abbiemery @DominicOram @EmsArnold @olliesilvester @Relm-Arrowny @oliwenmandiamond @noemifrisina

I have a feeling this may be controversial, so I would like opinions on this. This has been extremely useful for saxs-bluesky and IMO it means we have something closer to a minimum viable Domain-Specific Language (DSL)

@olliesilvester
Copy link
Contributor

olliesilvester commented Dec 1, 2025

There's definitely a need for this sort of thing. How have scientists/users been using this so far, and is there feedback?

I've experimented with similar things using ipython and jupyter notebooks, but it's hard to make it not clunky

@RJCD-Diamond
Copy link
Contributor Author

Scientists have been experimenting with this on i22 and @EmsArnold has used this. I'd say feedback has been broadly positive. The only complaint i've had is the clunkiness of having to put client.run() to execute a plan via blueapi.

@olliesilvester
Copy link
Contributor

Good to know, I'm a fan of this. I wonder if users would prefer to do this sort of thing in jupyter notebooks or just in a basic terminal. I guess it works fine for both anyway.

Maybe this can be a topic for the next athena drop-in, we can work out the best API + features for this

@Relm-Arrowny
Copy link
Contributor

Relm-Arrowny commented Dec 2, 2025

Not sure this is controversial, blueapi as it is, is very hard to use to run any experiment and this make it much easier.

Kind of related, we run a jupiter server on p99-k8s with an "option" of using the nexus writer for scientist to play with, it may be of interest. This is the startup I gave scientist https://github.com/DiamondLightSource/sm-bluesky/blob/main/demo/p99/stomp_setup.ipynb. You can play with it here: http://172.23.177.194:8888/lab/tree/work it is password protected, I can dm you the password if needed.

We all trying to found ways to make it easier.... may be it is time we try to come up with something we all use?

@RJCD-Diamond
Copy link
Contributor Author

Good to know, I'm a fan of this. I wonder if users would prefer to do this sort of thing in jupyter notebooks or just in a basic terminal. I guess it works fine for both anyway.

Maybe this can be a topic for the next athena drop-in, we can work out the best API + features for this

Sounds good!

@RJCD-Diamond RJCD-Diamond changed the title feat: Add a UserClient that can be used a scripting interface for blueapi feat: Add a UserClient that can be used as a scripting interface for blueapi Dec 3, 2025
@iain-hall
Copy link

I would find this useful as well. At some point I came up with some functions to wrap Blueapi calls to do something very similar, so having a common standard solution to this problem wouild be good. My current method for testing Blueapi with real hardware on a beamline is fire up GDA and use the Jython console!

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.

5 participants