Adopt the array API standard: foundation + CRPS pilot#133
Open
frazane wants to merge 26 commits into
Open
Conversation
…pand extension tests
…/ct honour the input framework
…v collapsing to float
…e comb divide-by-zero, remove dead test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First phase of the array API migration (Part of #132): replaces the hand-written
ArrayBackendabstraction with the Python array API standard viaarray-api-compat, inferring the framework from the input arrays, and migrates the CRPS family end-to-end as the pilot.Infrastructure
array-api-compatdependency.get_namespace, augmentedArrayAPINamespace) — pass numpy/jax/torch arrays and the result comes back in the same framework, no configuration.jax.scipy.special/torch.special/scipy.backend="numba".CRPS family
crps_*public wrappers and the CRPS core numerics are migrated to the inferred-namespace dispatch.Deprecations and behavior changes
backend="numpy"/"jax"/"torch"andregister_backend/backends.set_active(...)for array-API frameworks are deprecated; inference replaces them.backend="numba"is unaffected.interval_scoreandcrps_quantilepreviously defaulted to gufuncs and now requirebackend="numba"to opt in.NotImplementedErrorfor torch inputs (pass numpy or jax instead).Testing
Full suite green across numpy, numba, jax, and torch (705 passed, 16 skipped). CRPS tests exercise native arrays per framework and assert the inferred backend so a misrouted score can't silently fall back to numpy; added gradient tests for jax and torch.