Skip to content

Commit

Permalink
all tsts
Browse files Browse the repository at this point in the history
  • Loading branch information
Jammy2211 committed Nov 6, 2024
1 parent b9b373f commit 893d35b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
1 change: 1 addition & 0 deletions autolens/config/visualize/plots.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion autolens/point/model/visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions autolens/point/plot/fit_point_plotters.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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:

Expand Down
12 changes: 6 additions & 6 deletions test_autolens/point/plot/test_fit_point_plotters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []

Expand All @@ -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(
Expand Down

0 comments on commit 893d35b

Please sign in to comment.