diff --git a/autoconf/__init__.py b/autoconf/__init__.py index 3a0de8a..313b4ce 100644 --- a/autoconf/__init__.py +++ b/autoconf/__init__.py @@ -9,6 +9,7 @@ from .json_prior.config import JSONPriorConfig from .setup_colab import for_autolens +from .test_mode import test_mode_level, is_test_mode __version__ = "2026.4.5.3" diff --git a/autoconf/test_mode.py b/autoconf/test_mode.py new file mode 100644 index 0000000..537d05a --- /dev/null +++ b/autoconf/test_mode.py @@ -0,0 +1,20 @@ +import os + + +def test_mode_level(): + """ + Return the current test mode level. + + 0 = off (normal operation) + 1 = reduce sampler iterations to minimum (existing behavior) + 2 = bypass sampler entirely, call likelihood once + 3 = bypass sampler entirely, skip likelihood call + """ + return int(os.environ.get("PYAUTOFIT_TEST_MODE", "0")) + + +def is_test_mode(): + """ + Return True if any test mode is active. + """ + return test_mode_level() > 0