fix: PYAUTO_DISABLE_JAX has exactly one reader (#181 step 7) - #643
Merged
Conversation
af.Analysis.__init__ is the single resolver of PYAUTO_DISABLE_JAX + jax-availability; AnalysisLens.__init__ now always receives the base-resolved self._use_jax instead of the raw parameter, at all three call sites. Deletes the duplicate env read in AnalysisDataset (design failure mode 8) and FIXES a live bug: AnalysisPoint and the weak analysis silently undid the env downgrade (base set False, AnalysisLens overwrote True), so PYAUTO_DISABLE_JAX=1 was a no-op for them. Construction-level tests: env downgrade respected for AnalysisImaging and AnalysisPoint (the point test fails on pre-fix source), no over-downgrade when the env var is unset. Co-Authored-By: Claude Fable 5 <[email protected]>
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
Step 7 of the env-profile migration (PyAutoHands#181; design
PyAutoHands/docs/env_profile_redesign.md§5, failure mode 8):PYAUTO_DISABLE_JAXnow has exactly one reader —af.Analysis.__init__.AnalysisLens.__init__receives the base-resolvedself._use_jaxinstead of the raw parameter at all three call sites, andAnalysisDataset's duplicate pre-super()env read is deleted.This also fixes a live bug:
AnalysisPointand the weak analysis passed the rawuse_jaxtoAnalysisLens, whose assignment overwrites the base class's resolution — soPYAUTO_DISABLE_JAX=1was silently undone for them (they ran JAX in the nightly by accident).AnalysisDatasetmasked the same overwrite with its duplicate read, which also skipped the jax-not-installed downgrade the base applies —AnalysisLenscould disagree withself._use_jaxthere.API Changes
None — internal behaviour fix. Public signatures unchanged. Behavioural change only under
PYAUTO_DISABLE_JAX=1(release validation): point/weak analyses now honour the downgrade as designed.Test Plan
_use_jaxwasTruedespite env=1; passes after)test_autolens/analysis59 passed;test_autolens/point60 passedgrep -rn PYAUTO_DISABLE_JAX autolens/→ empty (only reader is the PyAutoFit base class)autolens_workspace_test/scripts/point_source/visualization.py— unmarked; every other point/weak script isjax_-marked or no_run'd; user workspaces pinPYAUTO_DISABLE_JAX: "0"so are untouched). Ran it under its exact NumPy release env with this branch on PYTHONPATH: pass, 8 s.Heart gate
Continuation of today's #181 work under the same human-acknowledged pre-existing RED. No downstream workspace edits required.
Generated by the PyAutoLabs agent workflow.
🤖 Generated with Claude Code