Skip to content

Add support for JAX v0.8#208

Open
mhliu0001 wants to merge 4 commits intomasterfrom
update_jax
Open

Add support for JAX v0.8#208
mhliu0001 wants to merge 4 commits intomasterfrom
update_jax

Conversation

@mhliu0001
Copy link
Contributor

This PR updates appletree to be compatible with JAX >= 0.8.0 while preserving backward compatibility with older supported JAX versions.

Key Changes

  1. Replace deprecated xla_bridge usage

Replaced:

from jax.lib import xla_bridge
xla_bridge.get_backend().platform

with the public API

jax.default_backend()

This avoids reliance on jax.lib.xla_bridge, which was removed in JAX 0.8.0, and uses a stable, documented interface.

  1. Remove deprecated keyword arguments in jnp.clip

Replaced calls of the form

jnp.clip(x, a_min=..., a_max=...)

with positional arguments:

jnp.clip(x, ..., ...)

This resolves deprecation warnings introduced in newer JAX versions while remaining compatible with older JAX releases, where the positional calling convention has long been supported.

  1. Relax JAX version constraint

Updated the dependency requirement to allow JAX versions < 0.9.0, enabling users to run with modern JAX while still protecting against untested future breaking changes.

Testing

All existing pytest tests were run and pass with: JAX 0.7.2, JAX 0.8.2. This confirms both backward compatibility and successful support for JAX >= 0.8.0.

@mhliu0001 mhliu0001 requested a review from dachengx January 14, 2026 18:18
@github-actions
Copy link

Pull Request Test Coverage Report for Build 21005071564

Details

  • 14 of 17 (82.35%) changed or added relevant lines in 3 files are covered.
  • 37 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.05%) to 84.065%

Changes Missing Coverage Covered Lines Changed/Added Lines %
appletree/config.py 0 1 0.0%
appletree/utils.py 4 6 66.67%
Files with Coverage Reduction New Missed Lines %
appletree/interpolation.py 15 72.05%
appletree/utils.py 22 62.19%
Totals Coverage Status
Change from base Build 18637300865: -0.05%
Covered Lines: 2432
Relevant Lines: 2893

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jan 14, 2026

Pull Request Test Coverage Report for Build 21005082325

Details

  • 17 of 19 (89.47%) changed or added relevant lines in 3 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.05%) to 84.065%

Changes Missing Coverage Covered Lines Changed/Added Lines %
appletree/config.py 0 1 0.0%
appletree/utils.py 4 5 80.0%
Files with Coverage Reduction New Missed Lines %
appletree/utils.py 1 62.19%
Totals Coverage Status
Change from base Build 18637300865: -0.05%
Covered Lines: 2432
Relevant Lines: 2893

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants