Redesign plan argument handling
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Refactorización
- Claridad
- Necesita aclaración
- Estado de actividad
- Activo
- Stack tecnológico
- python
- Área
- api, backend, backend-api-design
Línea de trabajo
No se nombran archivos ni pruebas. Empieza siguiendo la conversión actual de modelos de pydantic y el método inject; después, revisa los issues enlazados y la discusión existente para comparar los diseños propuestos. La tarea estará terminada cuando se haya decidido un enfoque que preserve los planes existentes y admita injection, elementos que no sean dispositivos, sobrescrituras compuestas, comprobación de tipos y argumentos posicionales o vararg sin los problemas de dependencias indicados.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
We currently build a pydantic model from the plan args and use that model to convert from the JSON params sent as part of a TaskRequest. This leads to several issues
- All arguments must be addressable via keywords. Positional only args and varargs are not supported
- Devices need special handling to convert from strings to devices #154
- Composite devices (built at runtime from existing devices) have their handling intertwined with the device name to device handling
- The
injectmethod we currently use to provide default arguments to plans means plans can't be run outside blueapi but this is not restricted by python. Eg, calling a plan defined asdef foo(mov: Movable = inject("bar")): ...fails with a run time error when trying to move the string instead of giving a type error. Type-checkers can't pick this up. - Non-devices are not supported (eg plans or clients for external services.)
Not directly related to using a model for validation but plan args are validated twice, once on submission and again when the plan is actually started.
Redesigning the way args are handled has been discussed several times and the general consensus was for the following requirements
- We shouldn't have to change every existing plan. This would need a huge amount of churn and introduce new version dependencies
- No new dependencies between blueapi and dodal/plan repo in either direction. A third API only package is not out of the question. (This may also be useful for utilities like the
DeviceManager) - Devices built by a device manager should be injectable in a similar way to the current system
- Non-devices should be available. Eg a config service client should be usable by plans without relying on global state
- Composite devices should be built at runtime with overrides of individual components if possible
- Type-checking should work
- Vararg and positional only args should be supported (#1185)
- Plan definitions should remain as simple as possible. A bit subjective but the current
injectmethod is fairly concise.- If possible, less duplication than the current system would be good, eg
foo: Movable = inject("foo")could be reduced to something likefoo: Injected(Movable)and the name would not need to be duplicated.
- If possible, less duplication than the current system would be good, eg
- Lenguaje dominante
- Python
- Estrellas
- 13
- Forks
- 14
- Merge medio
- 2 d 13 h
- PR fusionados (30 d)
- 18
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de DiamondLightSource/blueapi
-
kwargs: {} gets added to plan **kwargsPosiblemente ocupada @oliwenmandiamond la tomó hace 3 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
DiamondLightSource/blueapi#1719 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
deployment
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
DiamondLightSource/blueapi#1626 ·
Los mantenedores suelen responder en 1 día
-
deployment dev-environment
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
DiamondLightSource/blueapi#1623 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Cannot Install SoftiocAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
DiamondLightSource/blueapi#1605 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
DiamondLightSource/blueapi#1494 ·
Los mantenedores suelen responder en 1 día
Todos los issues de DiamondLightSource/blueapi
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
microsoft/agent-lightning#661 ·
Los mantenedores suelen responder en 2 días
-
area/profiles comp/cli P3 type/feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
NousResearch/hermes-agent#146372 ·
Los mantenedores suelen responder en 1 día
-
[BUG] OpenAI-compatible embedding model alias breaks embedder constructionPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
[oblt-aw][autodoc] Document obs-aw-automerge contract and fix automerge doc inconsistenciesPosiblemente ocupada @github-actions la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
GeoSeries scale and skew tests fail with pytest 9.2.0Posiblemente ocupada @jiayuasu la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día