feat: add skip_latents() to test_mode helpers#109
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
skip_latents()helper toautoconf/test_mode.py, mirroring the existingskip_visualization()/skip_checks()pattern. ReturnsTruewhen anyPYAUTO_TEST_MODElevel is active (test-mode fits mock the underlying samples, so latent values are not meaningful) and can also be triggered independently viaPYAUTO_SKIP_LATENTS=1for real-mode fits where the user wants to bypass the post-fitcompute_latent_samplespass.Consumed by PyAutoFit's
SearchUpdater._compute_latent_samplesshort-circuit (PyAutoLabs/PyAutoFit#1294). Tracking issue: PyAutoLabs/PyAutoFit#1294.API Changes
Added
autoconf.test_mode.skip_latents()returning abool. No other surface affected — purely additive.See full details below.
Test Plan
python -m pytest test_autoconf/passes (95/95).test_autofit/non_linear/search/test_updater.py) imports and uses it cleanly.Full API Changes (for automation & release notes)
Added
autoconf.test_mode.skip_latents() -> bool— returnsis_test_mode() or os.environ.get("PYAUTO_SKIP_LATENTS", "0") == "1". Composes the existingis_test_mode()trigger with a newPYAUTO_SKIP_LATENTSenv-var override.Removed / Renamed / Changed
None.
Migration
None. Existing callers of
is_test_mode(),skip_visualization(),skip_checks(),skip_fit_output()are unaffected.🤖 Generated with Claude Code