Skip to content

Commit b48a3f8

Browse files
Jammy2211Jammy2211
authored andcommitted
black
1 parent 6f48e13 commit b48a3f8

16 files changed

Lines changed: 212 additions & 133 deletions

File tree

autoarray/config/visualize/plots.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
# For example, if `plots: fit: subplot_fit=True``, the ``fit_dataset.png`` subplot file will
44
# be plotted every time visualization is performed.
55

6-
dataset: # Settings for plots of all datasets (e.g. ImagingPlotter, InterferometerPlotter).
6+
dataset: # Settings for plots of all datasets (e.g. Imaging, Interferometer).
77
subplot_dataset: true # Plot subplot containing all dataset quantities (e.g. the data, noise-map, etc.)?
8-
imaging: # Settings for plots of imaging datasets (e.g. ImagingPlotter)
8+
imaging: # Settings for plots of imaging datasets (e.g. Imaging)
99
psf: false
10-
fit: # Settings for plots of all fits (e.g. FitImagingPlotter, FitInterferometerPlotter).
10+
fit: # Settings for plots of all fits (e.g. FitImaging, FitInterferometer).
1111
subplot_fit: true # Plot subplot of all fit quantities for any dataset (e.g. the model data, residual-map, etc.)?
1212
subplot_fit_log10: true # Plot subplot of all fit quantities for any dataset using log10 color maps (e.g. the model data, residual-map, etc.)?
1313
data: false # Plot individual plots of the data?
@@ -18,8 +18,8 @@ fit: # Settings for plots of all fits (e.g
1818
normalized_residual_map: false # Plot individual plots of the normalized-residual-map?
1919
chi_squared_map: false # Plot individual plots of the chi-squared-map?
2020
residual_flux_fraction: false # Plot individual plots of the residual_flux_fraction?
21-
fit_imaging: {} # Settings for plots of fits to imaging datasets (e.g. FitImagingPlotter).
22-
inversion: # Settings for plots of inversions (e.g. InversionPlotter).
21+
fit_imaging: {} # Settings for plots of fits to imaging datasets (e.g. FitImaging).
22+
inversion: # Settings for plots of inversions (e.g. Inversion).
2323
subplot_inversion: true # Plot subplot of all quantities in each inversion (e.g. reconstrucuted image, reconstruction)?
2424
subplot_mappings: false # Plot subplot of the image-to-source pixels mappings of each pixelization?
2525
data_subtracted: false # Plot individual plots of the data with the other inversion linear objects subtracted?
@@ -30,6 +30,6 @@ inversion: # Settings for plots of inversions (e
3030
reconstructed_operated_data: false # Plot image of the reconstructed data (e.g. in the image-plane)?
3131
reconstruction: false # Plot the reconstructed inversion (e.g. the pixelization's mesh in the source-plane)?
3232
regularization_weights: false # Plot the effective regularization weight of every inversion mesh pixel?
33-
fit_interferometer: # Settings for plots of fits to interferometer datasets (e.g. FitInterferometerPlotter).
33+
fit_interferometer: # Settings for plots of fits to interferometer datasets (e.g. FitInterferometer).
3434
subplot_fit_dirty_images: false # Plot subplot of the dirty-images of all interferometer datasets?
3535
subplot_fit_real_space: false # Plot subplot of the real-space images of all interferometer datasets?

autoarray/inversion/mesh/interpolator/delaunay.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ def jax_delaunay(points, query_points, areas_factor=0.5):
9191
),
9292
points,
9393
query_points,
94+
vmap_method="sequential",
9495
)
9596

9697

@@ -248,6 +249,7 @@ def jax_delaunay_matern(points, query_points):
248249
(points_shape, simplices_padded_shape, mappings_shape),
249250
points,
250251
query_points,
252+
vmap_method="sequential",
251253
)
252254

253255

autoarray/operators/transformer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ def visibilities_from_jax(self, image: np.ndarray) -> np.ndarray:
356356
lambda img: self._pynufft_forward_numpy(img),
357357
result_shape,
358358
image,
359+
vmap_method="sequential",
359360
)
360361

361362
def visibilities_from(self, image, xp=np):

autoarray/plot/output.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,13 @@ def savefig(self, filename: str, output_path: str, format: str):
161161
pad_inches=0.1,
162162
)
163163
except ValueError as e:
164-
logger.info(f"""
164+
logger.info(
165+
f"""
165166
Failed to output figure as a .{format} or .fits due to the following error:
166167
167168
{e}
168-
""")
169+
"""
170+
)
169171

170172
def to_figure(
171173
self, structure: Optional[Structure], auto_filename: Optional[str] = None

autoarray/structures/arrays/rgb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def __init__(self, values, mask):
1010
the same functionality as `Array2D` objects.
1111
1212
By passing an RGB image to this class, the following visualization functionality is used when the RGB
13-
image is used in `Plotter` objects:
13+
image is used in plotting:
1414
1515
- The RGB image is plotted using the `imshow` function of Matplotlib.
1616
- Functionality which sets the scale of the axis, zooms the image, and sets the axis limits is used.

test_autoarray/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def make_plot_patch(monkeypatch):
3030
plot_patch = PlotPatch()
3131
monkeypatch.setattr(pyplot, "savefig", plot_patch)
3232
from matplotlib.figure import Figure
33+
3334
monkeypatch.setattr(Figure, "savefig", plot_patch)
3435
return plot_patch
3536

test_autoarray/fit/plot/test_fit_interferometer_plotters.py

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ def test__fit_quantities_are_output(fit_interferometer_7, plot_path, plot_patch)
3636
output_format="png",
3737
plot_axis_type="scatter",
3838
)
39-
assert path.join(plot_path, "real_residual_map_vs_uv_distances.png") in plot_patch.paths
39+
assert (
40+
path.join(plot_path, "real_residual_map_vs_uv_distances.png")
41+
in plot_patch.paths
42+
)
4043

4144
aplt.plot_yx_1d(
4245
y=np.real(fit_interferometer_7.chi_squared_map),
@@ -46,7 +49,10 @@ def test__fit_quantities_are_output(fit_interferometer_7, plot_path, plot_patch)
4649
output_format="png",
4750
plot_axis_type="scatter",
4851
)
49-
assert path.join(plot_path, "real_chi_squared_map_vs_uv_distances.png") in plot_patch.paths
52+
assert (
53+
path.join(plot_path, "real_chi_squared_map_vs_uv_distances.png")
54+
in plot_patch.paths
55+
)
5056

5157
aplt.plot_yx_1d(
5258
y=np.imag(fit_interferometer_7.chi_squared_map),
@@ -56,7 +62,10 @@ def test__fit_quantities_are_output(fit_interferometer_7, plot_path, plot_patch)
5662
output_format="png",
5763
plot_axis_type="scatter",
5864
)
59-
assert path.join(plot_path, "imag_chi_squared_map_vs_uv_distances.png") in plot_patch.paths
65+
assert (
66+
path.join(plot_path, "imag_chi_squared_map_vs_uv_distances.png")
67+
in plot_patch.paths
68+
)
6069

6170
aplt.plot_array_2d(
6271
array=fit_interferometer_7.dirty_image,
@@ -92,9 +101,18 @@ def test__fit_quantities_are_output(fit_interferometer_7, plot_path, plot_patch)
92101
)
93102

94103
assert path.join(plot_path, "data.png") in plot_patch.paths
95-
assert path.join(plot_path, "real_chi_squared_map_vs_uv_distances.png") in plot_patch.paths
96-
assert path.join(plot_path, "imag_chi_squared_map_vs_uv_distances.png") in plot_patch.paths
97-
assert path.join(plot_path, "real_residual_map_vs_uv_distances.png") not in plot_patch.paths
104+
assert (
105+
path.join(plot_path, "real_chi_squared_map_vs_uv_distances.png")
106+
in plot_patch.paths
107+
)
108+
assert (
109+
path.join(plot_path, "imag_chi_squared_map_vs_uv_distances.png")
110+
in plot_patch.paths
111+
)
112+
assert (
113+
path.join(plot_path, "real_residual_map_vs_uv_distances.png")
114+
not in plot_patch.paths
115+
)
98116

99117

100118
def test__fit_sub_plots(fit_interferometer_7, plot_path, plot_patch):

test_autoarray/fit/test_fit_imaging.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# Helper: build the "identical model, no masking" fit used by multiple tests
88
# ---------------------------------------------------------------------------
99

10+
1011
def _make_identical_fit_no_mask():
1112
mask = aa.Mask2D(mask=[[False, False], [False, False]], pixel_scales=(1.0, 1.0))
1213
data = aa.Array2D(values=[1.0, 2.0, 3.0, 4.0], mask=mask)

test_autoarray/fit/test_fit_interferometer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# Helpers
99
# ---------------------------------------------------------------------------
1010

11+
1112
def _make_dataset():
1213
real_space_mask = aa.Mask2D(
1314
mask=[[False, False], [False, False]], pixel_scales=(1.0, 1.0)

test_autoarray/inversion/pixelization/mappers/test_abstract.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ def test__adaptive_pixel_signals_from___matches_util(grid_2d_7x7, image_7x7):
133133
assert (pixel_signals == pixel_signals_util).all()
134134

135135

136-
def test__mapped_to_source_from__delaunay_mapper__matches_mapping_matrix_util(grid_2d_7x7):
136+
def test__mapped_to_source_from__delaunay_mapper__matches_mapping_matrix_util(
137+
grid_2d_7x7,
138+
):
137139
mesh_grid = aa.Grid2D.no_mask(
138140
values=[[0.1, 0.1], [1.1, 0.6], [2.1, 0.1], [0.4, 1.1], [1.1, 7.1], [2.1, 1.1]],
139141
shape_native=(3, 2),

0 commit comments

Comments
 (0)