Skip to content

fix: let optax follow the jax extra (autogalaxy[jax] -> autofit[jax]) - #530

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/validation-searches-env-optax
Jul 27, 2026
Merged

fix: let optax follow the jax extra (autogalaxy[jax] -> autofit[jax])#530
Jammy2211 merged 1 commit into
mainfrom
feature/validation-searches-env-optax

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Closes a user-facing packaging gap: pip install autolens[jax] does not install optax, so af.MultiStartAdam / af.MultiStartProdigy raise ImportError for users.

Problem

The jax extra chained autonerves[jax] directly, so the full chain

autolens[jax] -> autogalaxy[jax] -> autonerves[jax]     # jax, jaxlib, jaxnnls

stopped short of autofit[jax], which is where optax>=0.2.5 is declared. Anyone installing the JAX stack via autolens[jax] got JAX but not optax — and autofit's JAX-native gradient MAP searches import optax (Prodigy is resolved from optax.contrib).

This also left blackjax/optax absent in PyAutoHeart/workspace-validation, contributing to the red autofit_test/searches shard.

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 on autofit (pyproject.toml dependencies), so no new dependency edge is introduced.

API Changes

None to the Python API. Packaging metadata only — the jax extra now additionally resolves optax>=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 hit ImportError on the MultiStart gradient searches will now find optax present.

Verification

Built wheel metadata from this branch:

Requires-Dist: autofit[jax]; extra == "jax"
Requires-Dist: jax_zero_contour<3.0.0,>=2.0.0; python_version >= "3.11" and extra == "jax"

autofit[jax] in turn declares optax>=0.2.5, closing the chain to autolens[jax].

Companion PRs

Part of a three-repo fix for the red autofit_test/searches shard (autofit_workspace_test #78 + a PyAutoHeart workflow PR).

Refs PyAutoLabs/autofit_workspace_test#77

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 Jammy2211 added the pending-release PR queued for the next release build label Jul 27, 2026
@Jammy2211
Jammy2211 merged commit 5235ad8 into main Jul 27, 2026
5 checks passed
@Jammy2211
Jammy2211 deleted the feature/validation-searches-env-optax branch July 27, 2026 19:25
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-release PR queued for the next release build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant