Skip to content

Fix numba path mismatches in estimator validation and interval scores - #169

Merged
frazane merged 4 commits into
mainfrom
array-api/p4-gufunc-fixes
Nov 8, 2026
Merged

frazane merged 4 commits into
mainfrom
array-api/p4-gufunc-fixes

Conversation

@frazane

@frazane frazane commented Nov 8, 2026

Copy link
Copy Markdown
Owner

First PR of the Phase 4 stack (automatic numba). Before numba becomes the default for numpy inputs, the gufunc path has to behave like the array path. This fixes the three mismatches that do not depend on the gufunc rewrites later in the stack.

What changed

  • Estimators are checked against the public list before the gufunc lookup in crps_ensemble, es_ensemble, vs_ensemble, gksuv_ensemble and gksmv_ensemble (and their tw variants), so internal keys like "ownrg" raise the same ValueError on both paths.
  • weighted_interval_score on the array path normalises by the number of intervals instead of alpha's first dimension, which was wrong for batched alpha.
  • crps_quantile and weighted_interval_score promote their operands before the gufunc call, so float32 data with float64 alpha returns float64 on both paths.

Notes

The median term mismatch in weighted_interval_score (#140) is left to #141, so the new interval tests use w_median=0.

Closes #164, closes #168.


This change was developed in tandem with AI coding agents.

@github-actions github-actions Bot added the core Core scoring API / numerics label Nov 8, 2026
@frazane
frazane added this pull request to stack #171 November 8, 2026 14:15
@frazane
frazane merged commit b7cf64d into main Nov 8, 2026
27 checks passed
@frazane
frazane deleted the array-api/p4-gufunc-fixes branch November 8, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core scoring API / numerics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

weighted_interval_score uses the wrong K for batched alpha on the array path Internal gufunc names accepted as estimator with backend="numba"

1 participant