Adopt the array API standard for the multi-backend numeric core
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
- Bien especificado
- Estado de actividad
- Tranquilo
- Área
- backend, machine-learning
Línea de trabajo
Start by reading the existing ArrayBackend abstraction and the CRPS family entry points, then inspect how array-api-compat infers a namespace from input arrays. Phase 1 is complete when CRPS uses the shared inferred namespace and special-function layer, native arrays are tested across the listed frameworks, and unsupported torch special functions raise NotImplementedError; the remaining phases span all score families and backend removal.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Background
scoringrules runs every score across numpy, numba, jax, and torch through a hand-written ArrayBackend abstraction — an ABC with one concrete subclass per framework (~1400 lines). It works, but it's a maintenance burden: every new numeric primitive has to be added to the ABC and re-implemented in each backend, and users must explicitly select or register a backend.
The Python array API standard (via array-api-compat) now provides a portable, framework-agnostic surface that covers most of what we hand-rolled. Adopting it lets us infer the framework directly from the input arrays, drop most of the custom backend code, and return results in the caller's own framework with no configuration.
Goals
- Infer the array framework from input arrays instead of a global/registry selection.
- Replace the
ArrayBackendABC witharray-api-compatplus a thin extension layer for special functions the standard doesn't cover (erf, gamma, betainc, …). - Keep numba's compiled gufuncs as an explicit, opt-in fast path (
backend="numba"). - Deprecate registry-based backend selection; long-term, remove the
backend=argument entirely.
Approach
This touches all ten score families, so we're doing it in phases — family by family — with the shared infrastructure landing alongside the first pilot family.
- Phase 1 — Foundation + CRPS pilot. Add the
array-api-compatdependency; build the inference and augmented-namespace layer plus the native-first special-function extension layer; migrate the entire CRPS family end-to-end as the pilot. Deprecatebackend="numpy"/"jax"/"torch"andregister_backend/set_activefor array-API frameworks; mixed-framework inputs now raise. Tests exercise native arrays per framework and assert the inferred backend so a misrouted score can't silently fall back to numpy. - Phase 2 — Migrate the remaining families. Port the other nine families (energy, logs, brier, kernels, variogram, dss, interval, quantile, error_spread) and their weighted variants onto the same infrastructure, folding the parallel
_xphelper modules back into the shared core as each family moves over. - Phase 3 — Remove the old abstraction. Once every family is migrated, delete the
ArrayBackendABC, the per-framework subclasses, and the backend registry. - Phase 4 (long-term) — Remove
backend=entirely. Explore transparent auto-numba so the compiled fast path is selected automatically for numpy inputs, removing the need for the backend argument at all.
Behavior changes from Phase 1
- The default no longer routes through numba.
interval_scoreandcrps_quantilepreviously defaulted to gufuncs and now requirebackend="numba"to opt in. - torch has no native betainc / hyp2f1 / expi; scores needing those raise
NotImplementedErrorfor torch inputs (pass numpy or jax instead).
- Lenguaje dominante
- Python
- Estrellas
- 108
- Forks
- 15
- Merge medio
- 2 h
- PR fusionados (30 d)
- 19
Preparar el entorno
- Sin Dockerfile ni 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 frazane/scoringrules
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
frazane/scoringrules#176 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
frazane/scoringrules#163 ·
Los mantenedores suelen responder en 1 día
-
backend:torch bug documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
frazane/scoringrules#146 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
frazane/scoringrules#174 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
frazane/scoringrules#173 ·
Los mantenedores suelen responder en 1 día
Todos los issues de frazane/scoringrules
Issues similares
-
Djangonauts
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
render-engine/render-engine-cli#71 ·
Los mantenedores suelen responder en 1 día
-
Installation guide's prerequisites leave out ca-certificates, which a no-recommends system needsAbiertobot-found documentation priority: P3
Dificultad 1/5 Menos de una hora Aptitud para principiantes 94/100
madenvel/KalinkaPlayer#544 ·
-
debt python-version
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
microsoft/vscode-flake8#614 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 69/100
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 2 días