From 82a65010440b70a14aaea8ba19c275d7cc66ab4d Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 23 Aug 2026 01:19:23 +0000 Subject: [PATCH] maintenance: floor autonerves at the first release carrying the SMALLDAT stamp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The floor was `autonerves>=2026.8.22.1`, which predates the SMALLDAT regime stamp shipped by PyAutoNerves#153/#154. An autoarray installed from PyPI therefore resolved an autonerves whose writer emits no card at all: `should_simulate` saw an absent stamp, read it as "unknown", and fell back to the shape heuristic — which cannot see capped interferometer datasets, the case the stamp exists for. The fix was inert for anyone installing rather than running from a checkout. `autonerves 2026.8.23.1` is the first release carrying it. Verified by unpacking both wheels from PyPI rather than inferring from commit dates: 2026.8.22.1 has neither `stamp_small_datasets_regime` nor `SMALL_DATASETS_HEADER_KEY`, and still writes the `[""]` header comment; 2026.8.23.1 has both and the `""` fix. No release sits between them, so it is the first. Both floor reasons are now stated in the pin comment — the JAX-in-base-dependencies requirement (PyAutoLens#687/#702) stays load-bearing alongside the stamp. The rationale on the duplicated SMALLDAT literal in `dataset_util.py` was rewritten because this bump makes its stated reason false — it claimed the floor named a pre-stamp release, so an import would hard-fail. The duplication is kept anyway, for a different reason: a floor constrains dependency resolution only, and an editable checkout or `--no-deps` install can still put a pre-stamp autonerves on the path. The literal degrades to "card absent" and falls through to the shape heuristic; an import would be an ImportError at module load. Silent-safe beats hard-fail. Both fallbacks (`should_simulate`'s shape heuristic and `_is_capped_at_the_current_cap`) are untouched — every dataset already on disk is unstamped and depends on them. `test_autoarray/structures/arrays/files/array/output_test/array.fits` is regenerated as a byproduct: it is test output that the suite rmtrees and rewrites, and the newly-floored autonerves drops the `/ ['']` comment literal (PyAutoNerves#155). Verified cosmetic — identical cards, values, data and byte size; only the comment text differs. Leaving it stale would dirty the tree on every suite run under the new floor. Closes #482. Co-Authored-By: Claude --- autoarray/util/dataset_util.py | 18 +++++++++++----- pyproject.toml | 20 ++++++++++++++---- .../arrays/files/array/output_test/array.fits | Bin 5760 -> 5760 bytes 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/autoarray/util/dataset_util.py b/autoarray/util/dataset_util.py index afd91422f..b03699582 100644 --- a/autoarray/util/dataset_util.py +++ b/autoarray/util/dataset_util.py @@ -7,11 +7,19 @@ SMALL_DATASETS_PIXEL_SCALES = 0.6 # The FITS header card ``autonerves.fitsable.stamp_small_datasets_regime`` writes -# on every array the stack outputs. Deliberately duplicated here rather than -# imported: ``pyproject.toml`` floors autonerves at a release that predates the -# stamp, so an import would hard-fail against a legitimately-resolved older -# autonerves. Reading the card by name degrades to "absent" instead, which is -# exactly the fallback path below. Keep in sync with PyAutoNerves#153. +# on every array the stack outputs. Still deliberately duplicated here rather +# than imported, though the original reason has expired: the floor in +# ``pyproject.toml`` now names a stamped release, so importing the constant +# would resolve. The reason it stays a literal is what the floor does NOT +# cover. A floor constrains dependency *resolution* only; an editable checkout, +# a ``pip install --no-deps``, or a hand-built virtualenv can still put a +# pre-stamp autonerves on the path. Under this literal such an autonerves +# yields "card absent" and the reader falls through to the shape heuristic +# below — the safe direction, and the same path every pre-stamp dataset on disk +# already takes. Under an import it would be an ``ImportError`` at module load. +# Trading a silent-safe degradation for a hard failure to delete one string is +# the wrong way round, so the duplication is kept on purpose. +# Keep in sync with PyAutoNerves#153. SMALL_DATASETS_HEADER_KEY = "SMALLDAT" diff --git a/pyproject.toml b/pyproject.toml index 592f76b6d..b178d7621 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,10 +24,22 @@ classifiers = [ ] keywords = ["cli"] dependencies = [ - # Floor, not a pin (PyAutoLens#687) — bump to the first release with JAX - # in autonerves' base dependencies once it exists (PyAutoLens#702), so - # backtracking cannot pair this autoarray with a jax-optional autonerves. - "autonerves>=2026.8.22.1", + # Floor, not a pin (PyAutoLens#687). Two independent reasons hold it up; + # neither may be dropped without checking the other. + # + # 1. JAX in base dependencies (PyAutoLens#702) — the floor must name a + # release carrying `jax`/`jaxlib` in autonerves' *base* Requires-Dist, so + # backtracking cannot pair this autoarray with a jax-optional autonerves. + # Satisfied since 2026.8.22.1; every later release keeps them there. + # 2. The SMALLDAT regime stamp (PyAutoNerves#153/#154) — `should_simulate` + # prefers the header card that autonerves' writer stamps, and 2026.8.23.1 + # is the FIRST release whose `fitsable.stamp_small_datasets_regime` emits + # it. Against anything older the card is simply absent, the read side + # degrades to its shape heuristic, and capped *interferometer* datasets — + # shape-identical to full-resolution ones — go undetected. That is the + # case the stamp exists for, so the floor is what makes it reachable for + # an installed autoarray rather than a checkout. + "autonerves>=2026.8.23.1", "astropy>=5.0", "decorator>=4.0.0", "dill>=0.3.1.1", diff --git a/test_autoarray/structures/arrays/files/array/output_test/array.fits b/test_autoarray/structures/arrays/files/array/output_test/array.fits index d028d2d18597d94ca2d84236941cc1f8e37672aa..82bbcb8fd0e05f4c5d57fb30e183cbdcf8dcec8b 100644 GIT binary patch delta 40 kcmZqBZP4AYo^i4fv*F|ijPhXGfC)l3K#oAzEEMcCsL&_T&eQ^2l5RCKPT13U~7brVYXXUHB1N