BlueapiClient devices do not know about child devices until after user uses them

Aperta
#1,671 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@ZohebShaikh ci sta già lavorando.

Dal 8/10/2026.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

Inizia con il percorso di caricamento e caching dei dispositivi di BlueapiClient descritto nell’issue, quindi traccia il modo in cui DeviceManager fornisce i dispositivi e i dispositivi figli. Chiarisci se l’ambito include un albero dei dispositivi o repr e gli attributi riservati. Il lavoro dovrebbe considerarsi completato quando i dispositivi figli sono disponibili per il completamento automatico immediatamente dopo il caricamento, senza una ricerca preliminare.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug c: client enhancement

BlueapiClient asks blueapi server for all available devices and then caches them. This makes it so autocomplete now works on the terminal making it very handy when composing plans on command line. However, blueapi cannot handle child devices.

Very often, a device will hold a group of other devices / signals and need to be accessed to run plans. For example Motor stages will have x, y, z motor components. pgm devices have child signals/motors for energy.

So a very basic example would be

plans.set_absolute(pgm.energy, 500)
plans.set_absolute(stage.x, 10)
plans.set_absolute(stage.y, 20)

BlueapiClient has no idea these child devices of energy, x, and y exist so the user has to guess what is available.

How it works is if it doesn't exist from the cache, the device is requested from the server and then if it exists, it is then added to cache and then autocomplete now works. However, when loading devices, BlueapiClient should be aware of all devices on the server, including all child devices of a Device, so that automcomplete will work straight away rather than guessing first for all devices.

This is related to https://github.com/DiamondLightSource/dodal/issues/2208 because DeviceManager only provides the higher level devices to blueapi and not the device children so it has no concept of the child devices unless asked explicitly to check for it.

This would vastly improve the user experience using the client if you could print the device tree or the device __repr__ to show it (similiar to a plan __repr__ displays the plan signature) to know what is available to work with and that auto complete for child devices works from the start.

As we are going to have name clashes with device attributes and what blueapi needs, we should probably reserve in dodal device attributes so that they never have a model signal / sub device. Similar to how ophyd-async reserves bluesky key words. This could be done inside DeviceManager. When it loads in a device, it checks there are no signals / child devices with model as an attribute.

Lingua principale
Python
Stelle
14
Fork
14
Merge medio
2g 23h
PR unite (30g)
27

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di DiamondLightSource/blueapi

Tutte le issue di DiamondLightSource/blueapi

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.