Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#1,718 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
1-2 días
Aptitud para principiantes
52/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
Lenguaje dominante
Python
Estrellas
13
Forks
14
Merge medio
4 d 14 h
PR fusionados (30 d)
14

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de DiamondLightSource/blueapi

Todos los issues de DiamondLightSource/blueapi

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.