From e28849a93674569181d1b03c35fb4d53e28ddf48 Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Sun, 12 Apr 2026 13:11:10 +0100 Subject: [PATCH] refactor: separate PYAUTOFIT_TEST_MODE into distinct PYAUTO_* env vars Split the catch-all PYAUTOFIT_TEST_MODE into purpose-specific variables: - PYAUTO_TEST_MODE (sampler speedup, levels 0-3) - PYAUTO_SKIP_FIT_OUTPUT (pre/post-fit I/O, VRAM, result text) - PYAUTO_SKIP_VISUALIZATION (fit visualization and plotting) - PYAUTO_SKIP_CHECKS (mesh validation, position resampling, weight thresholds) Also renames: - PYAUTOARRAY_OUTPUT_MODE -> PYAUTO_OUTPUT_MODE - PYAUTO_WORKSPACE_SMALL_DATASETS -> PYAUTO_SMALL_DATASETS Co-Authored-By: Claude Opus 4.6 --- CLAUDE.md | 4 ++-- autolens/analysis/analysis/dataset.py | 4 ++-- autolens/analysis/result.py | 4 ++-- autolens/quantity/model/visualizer.py | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index eab483c1a..9df7513f2 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -38,10 +38,10 @@ black autolens/ ### Plot Output Mode -Set `PYAUTOARRAY_OUTPUT_MODE=1` to capture every figure produced by a script into numbered PNG files in `./output_mode//`. This is useful for visually inspecting all plots from an integration test without needing a display. +Set `PYAUTO_OUTPUT_MODE=1` to capture every figure produced by a script into numbered PNG files in `./output_mode//`. This is useful for visually inspecting all plots from an integration test without needing a display. ```bash -PYAUTOARRAY_OUTPUT_MODE=1 python scripts/my_script.py +PYAUTO_OUTPUT_MODE=1 python scripts/my_script.py # -> ./output_mode/my_script/0_fit.png, 1_tracer.png, ... ``` diff --git a/autolens/analysis/analysis/dataset.py b/autolens/analysis/analysis/dataset.py index 41bb80847..1047da1f2 100644 --- a/autolens/analysis/analysis/dataset.py +++ b/autolens/analysis/analysis/dataset.py @@ -31,7 +31,7 @@ from autolens.analysis.positions import PositionsLH from autolens import exc -from autoconf.test_mode import is_test_mode +from autoconf.test_mode import skip_checks logger = logging.getLogger(__name__) @@ -110,7 +110,7 @@ def __init__( raise_inversion_positions_likelihood_exception ) - if is_test_mode(): + if skip_checks(): self.raise_inversion_positions_likelihood_exception = False def modify_before_fit(self, paths: af.DirectoryPaths, model: af.Collection): diff --git a/autolens/analysis/result.py b/autolens/analysis/result.py index 2a7ac3fe5..723e06e2f 100644 --- a/autolens/analysis/result.py +++ b/autolens/analysis/result.py @@ -31,7 +31,7 @@ ) from autolens.lens.tracer import Tracer from autolens.point.solver import PointSolver -from autoconf.test_mode import is_test_mode +from autoconf.test_mode import skip_checks logger = logging.getLogger(__name__) @@ -304,7 +304,7 @@ def positions_likelihood_from( The `PositionsLH` object used to apply a likelihood penalty or resample the positions. """ - if is_test_mode(): + if skip_checks(): return positions = ( diff --git a/autolens/quantity/model/visualizer.py b/autolens/quantity/model/visualizer.py index d2b483946..3e705da0d 100644 --- a/autolens/quantity/model/visualizer.py +++ b/autolens/quantity/model/visualizer.py @@ -1,7 +1,7 @@ import os import autofit as af -from autoconf.test_mode import is_test_mode +from autoconf.test_mode import skip_visualization from autogalaxy.quantity.model.plotter import PlotterQuantity @@ -40,7 +40,7 @@ def visualize( via a non-linear search). """ - if is_test_mode(): + if skip_visualization(): return fit = analysis.fit_quantity_for_instance(instance=instance)