fix: let optax follow the jax extra (autogalaxy[jax] -> autofit[jax]) - #530
Merged
Conversation
The jax extra chained autonerves[jax] directly, so the full chain autolens[jax] -> autogalaxy[jax] -> autonerves[jax] stopped at jax/jaxlib/jaxnnls and never reached autofit[jax], which is where optax>=0.2.5 is declared. Users installing autolens[jax] therefore did not get optax, and af.MultiStartAdam / af.MultiStartProdigy raised ImportError. Strictly additive: autofit[jax] == [autonerves[jax], optax>=0.2.5], and PyAutoGalaxy already depends on autofit, so no new dependency edge. Verified against the built wheel metadata: Requires-Dist: autofit[jax]; extra == "jax" Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Jammy2211
added a commit
that referenced
this pull request
Jul 27, 2026
Follow-up to #530, from an independent Codex review of that commit. #530 pointed autogalaxy[jax] at autofit[jax] so optax follows the jax chain. PyAutoFit#1426 then marked autofit's own optax entry python>=3.11 after an unmarked optax took every 3.9 CI leg red with resolution-too-deep. But that fix lives on autofit's main. Any *released* autofit still expands autofit[jax] to an unmarked optax — confirmed against PyPI: autofit 2026.7.27.1 -> 'optax>=0.2.5; extra == "jax"' (no marker) So autogalaxy[jax] was only safe when autofit came from a source checkout, which is precisely why CI went green while the released chain stayed exposed. CI installs all five libraries with -e, so it could never have caught this. Marking the entry here makes the chain correct whichever autofit version pip resolves, and restores exact pre-#530 behaviour below 3.11: every member of the extra now carries the same gate, so the extra is a clean no-op there. Verified in the built wheel metadata — both jax-extra entries evaluate False on 3.9/3.10 and True on 3.11/3.12. Co-authored-by: Jammy2211 <JNightingale2211@gmail.com> Co-authored-by: Claude Opus 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.
Closes a user-facing packaging gap:
pip install autolens[jax]does not installoptax, soaf.MultiStartAdam/af.MultiStartProdigyraiseImportErrorfor users.Problem
The
jaxextra chainedautonerves[jax]directly, so the full chainstopped short of
autofit[jax], which is whereoptax>=0.2.5is declared. Anyone installing the JAX stack viaautolens[jax]got JAX but not optax — and autofit's JAX-native gradient MAP searches import optax (Prodigy is resolved fromoptax.contrib).This also left
blackjax/optaxabsent inPyAutoHeart/workspace-validation, contributing to the redautofit_test/searchesshard.Change
jax = ["autonerves[jax]", ...]->jax = ["autofit[jax]", ...].Strictly additive:
autofit[jax] == ["autonerves[jax]", "optax>=0.2.5"], so everything the old entry supplied is still supplied. PyAutoGalaxy already depends onautofit(pyproject.tomldependencies), so no new dependency edge is introduced.API Changes
None to the Python API. Packaging metadata only — the
jaxextra now additionally resolvesoptax>=0.2.5. This is purely additive: no extra loses a distribution, and no import path, signature or default changes. Downstream workspaces need no migration; users who previously hitImportErroron the MultiStart gradient searches will now find optax present.Verification
Built wheel metadata from this branch:
autofit[jax]in turn declaresoptax>=0.2.5, closing the chain toautolens[jax].Companion PRs
Part of a three-repo fix for the red
autofit_test/searchesshard (autofit_workspace_test #78 + a PyAutoHeart workflow PR).Refs PyAutoLabs/autofit_workspace_test#77