Skip to content

Commit be0b32e

Browse files
Jammy2211Jammy2211
authored andcommitted
informative exception
1 parent c2904c1 commit be0b32e

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

autolens/imaging/model/visualizer.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import logging
2+
13
from autoarray import exc
24

35
import autofit as af
@@ -8,6 +10,7 @@
810
from autolens.lens import tracer_util
911
from autolens import exc
1012

13+
logger = logging.getLogger(__name__)
1114

1215
class VisualizerImaging(af.Visualizer):
1316
@staticmethod
@@ -136,6 +139,9 @@ def visualize(
136139
try:
137140
fit.inversion.reconstruction
138141
except exc.InversionException:
142+
logger(
143+
ag.exc.invalid_linear_algebra_for_visualization_message()
144+
)
139145
return
140146

141147
zoom = ag.Zoom2D(mask=fit.mask)

autolens/interferometer/model/visualizer.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import logging
2+
13
import autofit as af
24
import autogalaxy as ag
35

@@ -7,6 +9,8 @@
79
from autolens.lens import tracer_util
810
from autogalaxy import exc
911

12+
logger = logging.getLogger(__name__)
13+
1014

1115
class VisualizerInterferometer(af.Visualizer):
1216
@staticmethod
@@ -106,7 +110,10 @@ def visualize(
106110
quick_update=quick_update,
107111
)
108112
except exc.InversionException:
109-
pass
113+
logger(
114+
ag.exc.invalid_linear_algebra_for_visualization_message()
115+
)
116+
return
110117

111118
if quick_update:
112119
return

0 commit comments

Comments
 (0)