From 0bb51da8da8377d1e7af5adb2f2bc04c1875bd90 Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Thu, 28 May 2026 14:19:01 +0100 Subject: [PATCH] fix(smoke): extend latent_variables smoke to new 8-key registry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PyAutoLabs/PyAutoLens#557 grows LATENT_FUNCTIONS from 5 keys to 8 (adds three raw-flux latents). Without this update the smoke test's exact-set assertion against LATENT_FUNCTIONS.keys() fails on a clean fit. - config/latent.yaml — enable all 6 flux latents (3 raw + 3 muJy) plus magnification and effective_einstein_radius; add explicit total_galaxy_0_flux: false to silence the autogalaxy cross-library warning that would otherwise fire on every fit - scripts/latent/latent_variables_smoke.py — EXPECTED_KEYS extended to all 8 registered library latents; docstring updated to describe the new grouping Refs PyAutoLabs/PyAutoLens#556 --- config/latent.yaml | 12 ++++++++++-- scripts/latent/latent_variables_smoke.py | 8 +++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/config/latent.yaml b/config/latent.yaml index 2e52f4bb..989f4e8b 100644 --- a/config/latent.yaml +++ b/config/latent.yaml @@ -1,9 +1,17 @@ # Workspace overrides for the library lensing latent toggles. Enables -# all five default latents so the smoke test exercises every entry in -# `autolens.analysis.latent.LATENT_FUNCTIONS`. See +# every entry in `autolens.analysis.latent.LATENT_FUNCTIONS` so the smoke +# test exercises the full registry. See # `scripts/latent/latent_variables_smoke.py`. +total_lens_flux: true +total_lensed_source_flux: true +total_source_flux: true total_lens_flux_mujy: true total_lensed_source_flux_mujy: true total_source_flux_mujy: true magnification: true effective_einstein_radius: true + +# autogalaxy library default (loaded by autoconf into the same `latent` +# conf node) — explicitly disabled here to silence the cross-library +# "unknown latent" warning that would otherwise fire on every fit. +total_galaxy_0_flux: false diff --git a/scripts/latent/latent_variables_smoke.py b/scripts/latent/latent_variables_smoke.py index 40473c39..c88acfa2 100644 --- a/scripts/latent/latent_variables_smoke.py +++ b/scripts/latent/latent_variables_smoke.py @@ -7,7 +7,10 @@ and asserts every default-enabled key in ``autolens.analysis.latent.LATENT_FUNCTIONS`` is present with a finite value in a loose order-of-magnitude bracket. -The workspace ``config/latent.yaml`` enables all five library latents. +The workspace ``config/latent.yaml`` enables every entry in +``LATENT_FUNCTIONS`` — three raw-flux latents (instrument-input-free), +three µJy variants (require ``magzero``, which the smoke fixture +supplies), plus ``magnification`` and ``effective_einstein_radius``. The brackets are deliberately loose so PYAUTO_SMALL_DATASETS grid mutations (15x15) still yield passing values; the goal is a structural regression guard, not Bayesian validation. @@ -43,6 +46,9 @@ result = search.fit(model=model, analysis=analysis) EXPECTED_KEYS = [ + "total_lens_flux", + "total_lensed_source_flux", + "total_source_flux", "total_lens_flux_mujy", "total_lensed_source_flux_mujy", "total_source_flux_mujy",