fix: gate autofit[jax] to python>=3.11 in the jax extra - #532
Merged
Conversation
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: Claude Opus 5 <noreply@anthropic.com>
Jammy2211
pushed a commit
that referenced
this pull request
Aug 9, 2026
…s here) The negative-redshift finding is filed on PyAutoLens#532 because the reporter reached it through `al.Galaxy` — but `al.Galaxy` IS `ag.Galaxy`, and both the class and its redshift assignment live in this repo, so the guard belongs here rather than in a Tracer-level check that would miss a bare Galaxy construction. The `Tracer(galaxies=...)` half of #532 stays in PyAutoLens. Zero and tiny redshifts stay accepted: 0.0 legitimately places a galaxy at the observer, and 1e-12 is degenerate but not invalid. Adds a deliberate guard-rail test pinning today's permissive z_lens > z_source behaviour, so phase 4 of the audit cannot quietly turn it into an error while the question is still open with the reporter. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013PgqSCLTemK5bApVAwhVM4
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.
Follow-up to #530, raised by an independent Codex review of that commit.
The gap
#530 pointed
autogalaxy[jax]atautofit[jax]so optax follows the jax chain. PyAutoFit#1426 then marked autofit's own optax entrypython_version >= '3.11', after an unmarked optax sent pip toresolution-too-deepand took every 3.9 leg ofpython_matrixred.But that fix lives on autofit's main. Any released autofit still expands
autofit[jax]to an unmarked optax — confirmed straight from PyPI:So
autogalaxy[jax]was only safe when autofit came from a source checkout. That is exactly why CI went green while the released chain stayed exposed:python_matrixinstalls all five libraries with-e ./PyAuto*, so it resolves autofit from source and can never exercise this path.Live exposure is narrow — installing autogalaxy/autolens from git
mainwith[jax]on Python 3.9/3.10 — because today's PyPI users get released autogalaxy, which does not chain toautofit[jax]yet, and the next release ships both libraries at the same version. But the window is real until then, and the fix is one line.Change
Now every member of the
jaxextra carries the same gate, so the extra is a clean no-op below 3.11 — exactly the pre-#530 behaviour — and correct on 3.11+ whichever autofit version pip resolves.API Changes
None. Packaging metadata only, and strictly narrowing.
autogalaxy[jax]on 3.11+ resolves exactly as #530 intended; on 3.9/3.10 it resolves exactly as it did before #530.Verification
Built wheel metadata from this branch:
Marker evaluation, both entries:
Lesson
Marker parity within an extra is load-bearing, and a source-installed CI matrix cannot verify a released dependency chain. An extra that mixes gated and ungated entries is only as correct as the version of its sibling that happens to resolve.