Skip to content

Commit fbb8af5

Browse files
authored
Merge pull request #419 from PyAutoLabs/feature/test-mode-bypass
Use centralized is_test_mode() from PyAutoFit
2 parents af6f4c5 + 55f3226 commit fbb8af5

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

autolens/analysis/analysis/dataset.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
from autolens.analysis.positions import PositionsLH
3232

3333
from autolens import exc
34+
from autofit.non_linear.test_mode import is_test_mode
3435

3536
logger = logging.getLogger(__name__)
3637

@@ -104,7 +105,7 @@ def __init__(
104105
raise_inversion_positions_likelihood_exception
105106
)
106107

107-
if os.environ.get("PYAUTOFIT_TEST_MODE") == "1":
108+
if is_test_mode():
108109
self.raise_inversion_positions_likelihood_exception = False
109110

110111
# Can be deleted after relevent AutoFIT PR merged

autolens/analysis/result.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
)
3232
from autolens.lens.tracer import Tracer
3333
from autolens.point.solver import PointSolver
34+
from autofit.non_linear.test_mode import is_test_mode
3435

3536
logger = logging.getLogger(__name__)
3637

@@ -303,7 +304,7 @@ def positions_likelihood_from(
303304
The `PositionsLH` object used to apply a likelihood penalty or resample the positions.
304305
"""
305306

306-
if os.environ.get("PYAUTOFIT_TEST_MODE") == "1":
307+
if is_test_mode():
307308
return
308309

309310
positions = (

autolens/quantity/model/visualizer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22

33
import autofit as af
4+
from autofit.non_linear.test_mode import is_test_mode
45

56
from autogalaxy.quantity.model.plotter import PlotterQuantity
67

@@ -39,7 +40,7 @@ def visualize(
3940
via a non-linear search).
4041
"""
4142

42-
if os.environ.get("PYAUTOFIT_TEST_MODE") == "1":
43+
if is_test_mode():
4344
return
4445

4546
fit = analysis.fit_quantity_for_instance(instance=instance)

0 commit comments

Comments
 (0)