Skip to content

Commit a7b5780

Browse files
authored
Merge pull request #404 from PyAutoLabs/feature/ag-quantity-fit-from
feat: wire ag.VisualizerQuantity through fit_for_visualization
2 parents 7f5dc8d + 7ca3168 commit a7b5780

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

autogalaxy/quantity/model/analysis.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,19 @@ def fit_quantity_for_instance(self, instance: af.ModelInstance) -> FitQuantity:
143143
dataset=self.dataset, light_mass_obj=galaxies, func_str=self.func_str
144144
)
145145

146+
def fit_from(self, instance: af.ModelInstance) -> FitQuantity:
147+
"""
148+
Standard-name alias for :meth:`fit_quantity_for_instance`.
149+
150+
Exposing ``fit_from`` lets the autofit base ``Analysis.fit_for_visualization``
151+
helper dispatch through the same JIT-cached wrapper as imaging /
152+
interferometer (it calls ``self.fit_from`` unconditionally). Without
153+
this method, ``use_jax_for_visualization=True`` on ``AnalysisQuantity``
154+
would be a silent no-op — see the Phase 0c shipped notes in
155+
``PyAutoPrompt/complete.md``.
156+
"""
157+
return self.fit_quantity_for_instance(instance=instance)
158+
146159
def save_attributes(self, paths: af.DirectoryPaths):
147160
"""
148161
Before the non-linear search begins, this routine saves attributes of the `Analysis` object to the `files`

autogalaxy/quantity/model/visualizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def visualize(
6969
if skip_visualization():
7070
return
7171

72-
fit = analysis.fit_quantity_for_instance(instance=instance)
72+
fit = analysis.fit_for_visualization(instance=instance)
7373

7474
plotter = PlotterQuantity(
7575
image_path=paths.image_path, title_prefix=analysis.title_prefix

0 commit comments

Comments
 (0)