Skip to content

Commit 8a55bf1

Browse files
Jammy2211claude
authored andcommitted
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 <noreply@anthropic.com>
1 parent 36014a5 commit 8a55bf1

3 files changed

Lines changed: 32 additions & 2 deletions

File tree

autoconf/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
from .setup_colab import for_autolens
1212
from .setup_notebook import setup_notebook
13-
from .test_mode import test_mode_level, is_test_mode
13+
from .test_mode import test_mode_level, is_test_mode, skip_fit_output, skip_visualization, skip_checks
1414

1515

1616
__version__ = "2026.4.5.3"

autoconf/test_mode.py

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,41 @@ def test_mode_level():
1010
2 = bypass sampler entirely, call likelihood once
1111
3 = bypass sampler entirely, skip likelihood call
1212
"""
13-
return int(os.environ.get("PYAUTOFIT_TEST_MODE", "0"))
13+
return int(os.environ.get("PYAUTO_TEST_MODE", "0"))
1414

1515

1616
def is_test_mode():
1717
"""
1818
Return True if any test mode is active.
1919
"""
2020
return test_mode_level() > 0
21+
22+
23+
def skip_fit_output():
24+
"""
25+
Return True if fit I/O should be skipped.
26+
27+
Controls: pre/post-fit output, VRAM profiling, result info text,
28+
likelihood function checks.
29+
"""
30+
return os.environ.get("PYAUTO_SKIP_FIT_OUTPUT", "0") == "1"
31+
32+
33+
def skip_visualization():
34+
"""
35+
Return True if fit visualization should be skipped.
36+
37+
Controls: Visualizer.should_visualize, plot decorators,
38+
quantity visualizers.
39+
"""
40+
return os.environ.get("PYAUTO_SKIP_VISUALIZATION", "0") == "1"
41+
42+
43+
def skip_checks():
44+
"""
45+
Return True if validation checks should be skipped.
46+
47+
Controls: mesh pixel validation (hilbert), position resampling,
48+
inversion position exceptions, sample weight thresholds.
49+
"""
50+
return os.environ.get("PYAUTO_SKIP_CHECKS", "0") == "1"

test_autoconf/files/array_out.fits

5.63 KB
Binary file not shown.

0 commit comments

Comments
 (0)