Skip to content

Commit d72f699

Browse files
Jammy2211claude
authored andcommitted
feat: add skip_latents() to test_mode helpers
New env-var-gated helper alongside skip_visualization() / skip_checks(). Returns True when any PYAUTO_TEST_MODE level is active, or when PYAUTO_SKIP_LATENTS=1 is set explicitly. Consumed by PyAutoFit's SearchUpdater._compute_latent_samples short-circuit (PyAutoLabs/PyAutoFit#1294). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent cc29850 commit d72f699

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

autoconf/test_mode.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,16 @@ def skip_checks():
4848
inversion position exceptions, sample weight thresholds.
4949
"""
5050
return os.environ.get("PYAUTO_SKIP_CHECKS", "0") == "1"
51+
52+
53+
def skip_latents():
54+
"""
55+
Return True if latent variable computation should be skipped.
56+
57+
Auto-enabled when any ``PYAUTO_TEST_MODE`` level is active (test-mode
58+
fits mock the underlying samples, so latent values are not meaningful)
59+
and can also be triggered independently via ``PYAUTO_SKIP_LATENTS=1``
60+
for real-mode fits where the user wants to bypass the post-fit
61+
``compute_latent_samples`` pass.
62+
"""
63+
return is_test_mode() or os.environ.get("PYAUTO_SKIP_LATENTS", "0") == "1"

0 commit comments

Comments
 (0)