Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Python client plan __repr__ doesn't take into account *args **kwargs

Aperta
#1,718 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
1-2 giorni
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

The issue identifies the Python client plan cache __repr__ and the schema as the areas to investigate; it does not name files or tests. Start by tracing how the schema supplies plan parameter information to the client representation. Done means the representation shows *args, **kwargs, tuple parameters, and their required types correctly, as in the acceptance criterion.

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

Descrizione

When using the python client, is it extremely useful for a user to understand what parameters a plan takes. They can remind them selves by simply typing the plan name and the __repr__ will display a string representation of the plan parameters.

The current schema doesn't have enough information for the client to correctly rebuild the required plan arguments to inform a user what a plan parameters expect to take. Currently blueapi would provide the user the below:

>>> bc.plans.step_grid_scan
step_grid_scan(
    detectors: list[Readable | AsyncReadable],
    trajectory: list[Any],
    extra_trajectories: list[list[Any]] | None = None,
    snake_axes: bool = True,
    metadata: dict | None = None
) 

However, this should look like this instead:

>>> pl.step_grid_scan
step_grid_scan(
    detectors: Sequence[Readable | AsyncReadable],
    trajectory: tuple[Movable[float], float, float, float],
    *extra_trajectories: tuple[Movable[float], float, float, float],
    snake_axes: bool = True,
    metadata: dict[str, Any] | None = None
)

As you can see, the current implementation doesn't show the user what parameters are * and **. It also doesn't handle tuples or able to resolve the required types inside the tuple.

I got this working with a proof of concept here https://github.com/DiamondLightSource/blueapi/pull/1663 but is too stale and too hard to rebase as it was based on original *args **kwargs implementation with V1 and V2 task and parameters. It adds additional information to assist the schema, though it should probably enhance the schema.

Acceptance Criteria

  • Client plan cache __repr__ displays to a user the correct parameters a plan should take
Lingua principale
Python
Stelle
13
Fork
14
Merge medio
4g 14h
PR unite (30g)
14

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.