feat: JAX as a default dependency, marker-gated for Intel macOS (PyAutoLens#702) - #150
Merged
Conversation
…ition (PyAutoLens#702) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
Promotes JAX from the optional
[jax]extra into the base dependencies (PyAutoLens#702):jax/jaxlib>=0.7,<0.11(the planned cap widen to<0.12is reverted: jax 0.11.1 breaks autofit's beta/gamma messagelog_partitionunder jit — tracked as a separate compat task) andjaxnnls==1.0.1now install with a plainpip install autonerves. The three deps carry the environment markersys_platform != "darwin" or platform_machine == "arm64"so Intel Macs — where jaxlib publishes nomacosx_x86_64wheels for>=0.7— resolve cleanly to the NumPy-only path instead of failing at install. The[jax]extra is kept as a declared no-op alias sopip install autonerves[jax]keeps resolving (removing it would revive the pip history-walk trap of PyAutoLens#687 in reverse).jax_wrappernow emits a one-timelogger.warningat import when JAX is absent (NumPy-only mode, reduced performance, how to restore) — the NumPy fallback stays fully supported but is never silent.API Changes
None — no Python API changes. Packaging: JAX moves from the
[jax]extra into the default dependencies (marker-gated for Intel macOS);[jax]becomes a no-op alias.See full details below.
Test Plan
pytest test_autonerves/passes with JAX installedpytest test_autonerves/passes in a clean venv with JAX uninstalled (157/157), and the new import warning fires exactly onceunittest-nojax) green once the Heart PR mergesFull API Changes (for automation & release notes)
Changed Behaviour
pip install autonervesnow installsjax,jaxlib(>=0.7,<0.11) andjaxnnlsby default on all platforms except Intel (x86_64) macOS.autonerves.jax_wrapperlogs a one-time warning at import when JAX is not installed.Migration
pip install autonerves[jax]pip install autonerves(the[jax]form still works — no-op alias)Part of the six-repo JAX-default-dependency change: PyAutoLens#702.
Generated by the PyAutoLabs agent workflow.