Skip to content

Commit 926f55b

Browse files
Jammy2211claude
authored andcommitted
Make output_format configurable, default to "show" for interactive display
Add output_format config option to visualize/general.yaml so users get interactive matplotlib windows by default instead of silently saving PNGs. Tests pass output_format="png" explicitly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c2733f8 commit 926f55b

File tree

12 files changed

+53
-31
lines changed

12 files changed

+53
-31
lines changed

autoarray/config/visualize/general.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ general:
55
log10_min_value: 1.0e-4 # If negative values are being plotted on a log10 scale, values below this value are rounded up to it (e.g. to remove negative values).
66
log10_max_value: 1.0e99 # If positive values are being plotted on a log10 scale, values above this value are rounded down to it.
77
zoom_around_mask: true # If True, plots of data structures with a mask automatically zoom in the masked region.
8+
output_format: show # Default output format: "show" displays the figure interactively via plt.show(), "png"/"pdf"/etc. saves to file.
89
inversion:
910
reconstruction_vmax_factor: 0.5
1011
total_mappings_pixels: 8 # The number of source pixels used when plotting the subplot_mappings of a pixelization.

autoarray/dataset/plot/imaging_plots.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def subplot_imaging_dataset(
99
dataset,
1010
output_path: Optional[str] = None,
1111
output_filename: str = "dataset",
12-
output_format: str = "png",
12+
output_format: str = None,
1313
colormap=None,
1414
use_log10: bool = False,
1515
grid=None,
@@ -148,7 +148,7 @@ def subplot_imaging_dataset_list(
148148
dataset_list,
149149
output_path=None,
150150
output_filename: str = "dataset_combined",
151-
output_format="png",
151+
output_format=None,
152152
):
153153
"""
154154
n×3 subplot showing core components for each dataset in a list.

autoarray/dataset/plot/interferometer_plots.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def subplot_interferometer_dataset(
1414
dataset,
1515
output_path: Optional[str] = None,
1616
output_filename: str = "dataset",
17-
output_format: str = "png",
17+
output_format: str = None,
1818
colormap=None,
1919
use_log10: bool = False,
2020
):
@@ -95,7 +95,7 @@ def subplot_interferometer_dirty_images(
9595
dataset,
9696
output_path: Optional[str] = None,
9797
output_filename: str = "dirty_images",
98-
output_format: str = "png",
98+
output_format: str = None,
9999
colormap=None,
100100
use_log10: bool = False,
101101
):

autoarray/fit/plot/fit_imaging_plots.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def subplot_fit_imaging(
1010
fit,
1111
output_path: Optional[str] = None,
1212
output_filename: str = "fit",
13-
output_format: str = "png",
13+
output_format: str = None,
1414
colormap=None,
1515
use_log10: bool = False,
1616
residuals_symmetric_cmap: bool = True,

autoarray/fit/plot/fit_interferometer_plots.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def subplot_fit_interferometer(
1212
fit,
1313
output_path: Optional[str] = None,
1414
output_filename: str = "fit",
15-
output_format: str = "png",
15+
output_format: str = None,
1616
colormap=None,
1717
use_log10: bool = False,
1818
residuals_symmetric_cmap: bool = True,
@@ -107,7 +107,7 @@ def subplot_fit_interferometer_dirty_images(
107107
fit,
108108
output_path: Optional[str] = None,
109109
output_filename: str = "fit_dirty_images",
110-
output_format: str = "png",
110+
output_format: str = None,
111111
colormap=None,
112112
use_log10: bool = False,
113113
residuals_symmetric_cmap: bool = True,

autoarray/inversion/plot/inversion_plots.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def subplot_of_mapper(
2121
mapper_index: int = 0,
2222
output_path: Optional[str] = None,
2323
output_filename: str = "inversion",
24-
output_format: str = "png",
24+
output_format: str = None,
2525
colormap=None,
2626
use_log10: bool = False,
2727
mesh_grid=None,
@@ -233,7 +233,7 @@ def subplot_mappings(
233233
pixelization_index: int = 0,
234234
output_path: Optional[str] = None,
235235
output_filename: str = "mappings",
236-
output_format: str = "png",
236+
output_format: str = None,
237237
colormap=None,
238238
use_log10: bool = False,
239239
mesh_grid=None,

autoarray/inversion/plot/mapper_plots.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def plot_mapper(
1515
solution_vector=None,
1616
output_path: Optional[str] = None,
1717
output_filename: str = "mapper",
18-
output_format: str = "png",
18+
output_format: str = None,
1919
colormap=None,
2020
use_log10: bool = False,
2121
vmin=None,
@@ -84,7 +84,7 @@ def subplot_image_and_mapper(
8484
image,
8585
output_path: Optional[str] = None,
8686
output_filename: str = "image_and_mapper",
87-
output_format: str = "png",
87+
output_format: str = None,
8888
colormap=None,
8989
use_log10: bool = False,
9090
mesh_grid=None,

autoarray/plot/array.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def plot_array(
6060
figsize: Optional[Tuple[int, int]] = None,
6161
output_path: Optional[str] = None,
6262
output_filename: str = "array",
63-
output_format: str = "png",
63+
output_format: str = None,
6464
) -> None:
6565
"""
6666
Plot a 2D array (image) using ``plt.imshow``.

autoarray/plot/grid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def plot_grid(
4040
figsize: Optional[Tuple[int, int]] = None,
4141
output_path: Optional[str] = None,
4242
output_filename: str = "grid",
43-
output_format: str = "png",
43+
output_format: str = None,
4444
) -> None:
4545
"""
4646
Plot a 2D grid of ``(y, x)`` coordinates as a scatter plot.

autoarray/plot/inversion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def plot_inversion_reconstruction(
3434
figsize: Optional[Tuple[int, int]] = None,
3535
output_path: Optional[str] = None,
3636
output_filename: str = "reconstruction",
37-
output_format: str = "png",
37+
output_format: str = None,
3838
) -> None:
3939
"""
4040
Plot an inversion reconstruction using the appropriate mapper type.

0 commit comments

Comments
 (0)