From 893d35bd13cea13bfde4d24fa6a544032d46e7a8 Mon Sep 17 00:00:00 2001 From: James Nightingale Date: Wed, 6 Nov 2024 19:44:15 +0000 Subject: [PATCH] all tsts --- autolens/config/visualize/plots.yaml | 1 + autolens/point/model/visualizer.py | 2 +- autolens/point/plot/fit_point_plotters.py | 9 +++++---- test_autolens/point/plot/test_fit_point_plotters.py | 12 ++++++------ 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/autolens/config/visualize/plots.yaml b/autolens/config/visualize/plots.yaml index 33549de9b..d1c85c0ea 100644 --- a/autolens/config/visualize/plots.yaml +++ b/autolens/config/visualize/plots.yaml @@ -8,6 +8,7 @@ positions: # Settings for plots with resampling image-positions on (e.g. the image). image_with_positions: true point_dataset: # Settings for plots of point source datasets (e.g. PointDatasetPlotter). + subplot_dataset: true # Plot subplot containing all dataset quantities (e.g. the data, noise-map, etc.)? positions: false # Plot the positions of th multiple images of the point source in the image plane? fluxes: false # Plot the fluxes of the multiple images of the point source in the image plane? fit: # Settings for plots of all fits (e.g. FitImagingPlotter, FitInterferometerPlotter). diff --git a/autolens/point/model/visualizer.py b/autolens/point/model/visualizer.py index 3d6e64a67..1cec8e660 100644 --- a/autolens/point/model/visualizer.py +++ b/autolens/point/model/visualizer.py @@ -76,7 +76,7 @@ def visualize( tracer = fit.tracer - grid = ag.Grid2D.from_extent(extent=fit.dataset.extent, shape_native=(100, 100)) + grid = ag.Grid2D.from_extent(extent=fit.dataset.extent_from(), shape_native=(100, 100)) plotter_interface.tracer( tracer=tracer, grid=grid, during_analysis=during_analysis diff --git a/autolens/point/plot/fit_point_plotters.py b/autolens/point/plot/fit_point_plotters.py index 1c29edd5f..16eb8b220 100644 --- a/autolens/point/plot/fit_point_plotters.py +++ b/autolens/point/plot/fit_point_plotters.py @@ -1,11 +1,10 @@ -from autoarray.plot.abstract_plotters import AbstractPlotter - import autogalaxy.plot as aplt +from autolens.plot.abstract_plotters import Plotter from autolens.point.fit.dataset import FitPointDataset -class FitPointDatasetPlotter(AbstractPlotter): +class FitPointDatasetPlotter(Plotter): def __init__( self, fit: FitPointDataset, @@ -37,7 +36,9 @@ def figures_2d(self, positions: bool = False, fluxes: bool = False): if positions: visuals_2d = self.get_visuals_2d() - visuals_2d += visuals_2d.__class__(multiple_images=self.fit.positions.model_data) + visuals_2d += visuals_2d.__class__( + multiple_images=self.fit.positions.model_data + ) if self.mat_plot_2d.axis.kwargs.get("extent") is None: diff --git a/test_autolens/point/plot/test_fit_point_plotters.py b/test_autolens/point/plot/test_fit_point_plotters.py index 278fe9b8f..d544e8de7 100644 --- a/test_autolens/point/plot/test_fit_point_plotters.py +++ b/test_autolens/point/plot/test_fit_point_plotters.py @@ -29,15 +29,15 @@ def test__fit_point_quantities_are_output( fit_point_plotter.figures_2d(positions=True, fluxes=True) - assert path.join(plot_path, "fit_point_dataset_positions.png") in plot_patch.paths - assert path.join(plot_path, "fit_point_dataset_fluxes.png") in plot_patch.paths + assert path.join(plot_path, "fit_point_positions.png") in plot_patch.paths + assert path.join(plot_path, "fit_point_fluxes.png") in plot_patch.paths plot_patch.paths = [] fit_point_plotter.figures_2d(positions=True, fluxes=False) - assert path.join(plot_path, "fit_point_dataset_positions.png") in plot_patch.paths - assert path.join(plot_path, "fit_point_dataset_fluxes.png") not in plot_patch.paths + assert path.join(plot_path, "fit_point_positions.png") in plot_patch.paths + assert path.join(plot_path, "fit_point_fluxes.png") not in plot_patch.paths plot_patch.paths = [] @@ -51,8 +51,8 @@ def test__fit_point_quantities_are_output( fit_point_plotter.figures_2d(positions=True, fluxes=True) - assert path.join(plot_path, "fit_point_dataset_positions.png") in plot_patch.paths - assert path.join(plot_path, "fit_point_dataset_fluxes.png") not in plot_patch.paths + assert path.join(plot_path, "fit_point_positions.png") in plot_patch.paths + assert path.join(plot_path, "fit_point_fluxes.png") not in plot_patch.paths def test__subplot_fit(