Repository navigation
test_mode: add disable_jax() predicate and stamp the small-datasets cap shape into FITS headers - #160
Merged
Merged
Conversation
…ap shape
Two harness-level facts the base layer owns but did not expose.
`PYAUTO_DISABLE_JAX` is documented by the workspace guides as the global
switch for forcing the NumPy path, but had no predicate beside
`small_datasets()` and friends — which is why it was read by a bare
`os.environ.get` in exactly one place in the whole stack while
`apply_sparse_operator` ignored it. `disable_jax()` gives it the same shape
as every other `PYAUTO_*` switch, compared against the exact string "1".
`SMALLDAT = T` records "the env var was set at write time", which is not the
proposition a reader deciding whether to reuse a dataset asks — that one is
"capped at today's cap". Readers therefore had to corroborate the card
against the measured shape of `data.fits`, which interferometer data
`(n_visibilities, 2)` and multi_dataset's prefixed `{waveband}_data.fits`
structurally cannot do, so those families are deleted and re-simulated on
every run. `SMALLSHP` records the cap itself (`"<rows>x<cols>"`), written
only in the capped regime, so absence keeps meaning "unknown" and readers
fall back to what they did before.
On the import direction the issue raises: autonerves does not import
autoarray, at module level or lazily. The cap shape constant now has its
canonical home here in `test_mode`, beside the regime switch it belongs to
and one layer below the library that applies it; `autoarray` keeps its own
literal of the same value, for the reason already recorded there against
`SMALL_DATASETS_HEADER_KEY` — a `--no-deps` or editable install can put a
pre-stamp autonerves on the path, where a literal degrades safely ("card
absent" -> the shape heuristic) and an import would be an `ImportError` at
module load. The drift guard the duplication needs is a test in that repo,
which can see both constants.
Refs #159
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0151gQm9fk3XGLi5f18Urdba
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 #159. Phase 8c (library leg) of the
ci-timing-fast-testsepic (PyAutoMinddraft/feature/pyautoheart/ci_timing_fast_tests_epic.md) — the Nerves half of two findings from the phase-8 user-workspace smoke diagnosis (autolens_workspace#536). The PyAutoArray PR (PyAutoArray#528) reads the card and uses the predicate; this one lands first (library-first).Summary
autonerves/test_mode.py:disable_jax()— the predicate forPYAUTO_DISABLE_JAX=1, documented besidesmall_datasets(). Until now the variable was read by a bareos.environ.getin exactly one place in the stack while two workspace guides document it as the global switch.autonerves/fitsable.py: besideSMALLDAT,stamp_small_datasets_regimenow writes aSMALLSHPcard ("<rows>x<cols>") under the cap, recording the cap shape in force in the writing process. Absent on every file written before this card existed; readers treat absence as unknown (today's behaviour). This is what letsautoarray.util.dataset_utilstop re-simulating capped interferometer / multi_dataset datasets on every run (~26 s per autolens_workspace CI run, ~28 s per autogalaxy_workspace run) — those families cannot corroborateSMALLDATby shape.Test Plan
python3 -m pytest -q -n auto— 182 passedlib-tests.ymlon the PR (both Python legs)🤖 Generated with Claude Code
https://claude.ai/code/session_0151gQm9fk3XGLi5f18Urdba
Generated by Claude Code