Make Executor a base class so new attributes don't break out-of-tree executors
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 45/100
Línea de trabajo
Start in climate_ref_core/executor.py, where Executor is a runtime_checkable Protocol, then check the isinstance gate in ExecutorConfig.build at climate_ref/config.py:397. Convert Executor to an ABC with abstract run and join, and give collects_results_on_join, runs_on_solve_host and log_submission_summary defaults. Make LocalExecutor, SynchronousExecutor, HPCExecutor and CeleryExecutor subclass it, and replace the solver's getattr probes with attribute access. Done when the in-tree executors pass the isinstance check and the test suite is green.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Executor (climate_ref_core/executor.py) is a @runtime_checkable Protocol, and ExecutorConfig.build rejects any executor that fails isinstance(executor, Executor) (climate_ref/config.py:397). A runtime protocol check requires every member, including data attributes, so adding a member to the protocol breaks every out-of-tree executor. collects_results_on_join did this in e4ada47bc without a changelog entry.
Optional behaviour is also probed with getattr in the solver (collects_results_on_join, log_submission_summary, and runs_on_solve_host from #955), so these attributes are invisible to type checkers and docs. The in-tree executors are inconsistent: CeleryExecutor subclasses Executor, while LocalExecutor, SynchronousExecutor and HPCExecutor do not.
Suggested fix:
- Turn
Executorinto an abstract base class withrunandjoinas abstract methods. - Give the optional flags and hooks defaults on the base class (
collects_results_on_join = False,runs_on_solve_host = False, a no-oplog_submission_summary). - Make all four in-tree executors subclass it and replace the solver's
getattrprobes with attribute access. - Keep the
isinstancecheck inExecutorConfig.build.
This is a one-off breaking change as out-of-tree executors must subclass Executor, although I doubt that this will impact anyone. After that, new flags with defaults break nobody.
- Lenguaje dominante
- Python
- Estrellas
- 27
- Forks
- 14
- Merge medio
- 1 d 2 h
- PR fusionados (30 d)
- 75
Preparar el entorno
- 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 Climate-REF/climate-ref
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Climate-REF/climate-ref#701 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Climate-REF/climate-ref#442 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Climate-REF/climate-ref#1040 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Climate-REF/climate-ref#996 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Climate-REF/climate-ref#991 ·
Los mantenedores suelen responder en 1 día
Todos los issues de Climate-REF/climate-ref
Issues similares
-
priority middle
Dificultad 1/5 Menos de una hora Aptitud para principiantes 62/100
KATO-Hiro/AtCoderClans#12940 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 76/100
huggingface/huggingface_hub#5283 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
ccxt/ccxt#31045 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug example
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 1 día