release: v0.5.2 — restore JAX 0.11 compatibility - #139
Merged
Conversation
Maintenance release that restores compatibility with JAX 0.11. - Source `is_constant_dim` through the version-aware `_compatible_import` shim (jax.core on JAX < 0.10, jax._src.core on JAX >= 0.10) and route `math.einsum` through it, fixing an AttributeError on JAX 0.11 (#135). - Annotate the version-guarded `concrete_or_error` / `is_constant_dim` fallback imports and align the export test with `__all__`, unblocking the mypy type_check CI job (#138). - Bump actions/checkout 6->7 (#134) and actions/setup-python 6->7 (#136).
Contributor
Reviewer's GuideMaintenance release v0.5.2 that restores JAX 0.11 compatibility for saiunit.math.einsum via the compatibility shim, exposes is_constant_dim from the compatibility layer (with a JAX-less stub), updates typing and tests around the shim, and bumps CI GitHub Action versions. Sequence diagram for einsum using the compatibility shim for is_constant_dimsequenceDiagram
actor User
participant einsum as saiunit.math.einsum
participant compat as saiunit._compatible_import.is_constant_dim
participant jax_core as jax.core.is_constant_dim
participant jax_src_core as jax._src.core.is_constant_dim
participant require_jax
User->>einsum: call einsum(...)
einsum->>compat: is_constant_dim(dim)
alt JAX_installed_and_version_<_0_10
compat->>jax_core: is_constant_dim(dim)
jax_core-->>compat: result
else JAX_installed_and_version_>=_0_10
compat->>jax_src_core: is_constant_dim(dim)
jax_src_core-->>compat: result
else JAX_not_installed
compat->>require_jax: is_constant_dim(dim)
require_jax-->>compat: raise ImportError
end
compat-->>einsum: result_or_error
einsum-->>User: einsum_result_or_error
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Summary
Maintenance release bumping the version to 0.5.2. The public API is unchanged, so this is a drop-in upgrade from 0.5.1.
The release centers on restoring compatibility with JAX 0.11: the
is_constant_dimhelper used bysaiunit.math.einsumwas removed from the publicjax.corenamespace in JAX 0.11, and is now sourced through the version-awaresaiunit._compatible_importshim.Changes
einsumon JAX 0.11 — importis_constant_dimvia_compatible_import(publicjax.coreon JAX < 0.10, privatejax._src.coreon JAX ≥ 0.10) and route_einops.pythrough the shim instead ofjax.core.is_constant_dimdirectly (fix: source is_constant_dim from jax._src.core on JAX>=0.11 #135).is_constant_dimfrom_compatible_import.__all__with arequire_jaxstub for JAX-less installs (fix: source is_constant_dim from jax._src.core on JAX>=0.11 #135).mypytype-check gate — annotate the version-guardedconcrete_or_error/is_constant_dimfallback imports and align the compatibility export test with__all__(test: align _compatible_import EXPORTS with __all__ (fix CI) #138).actions/checkout6→7 (⬆️ Bump actions/checkout from 6 to 7 #134) andactions/setup-python6→7 (⬆️ Bump actions/setup-python from 6 to 7 #136).Verification
mypy saiunit/exits 0.import saiunit; saiunit.__version__ == "0.5.2".See
changelog.mdfor the full Version 0.5.2 notes.Summary by Sourcery
Release version 0.5.2 as a maintenance update restoring JAX 0.11 compatibility without changing the public API.
Enhancements:
CI:
Documentation:
Chores: