Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
Jammy2211 committed Oct 28, 2024
1 parent 769b348 commit f482e4e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
11 changes: 7 additions & 4 deletions autoarray/inversion/plot/inversion_plotters.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,17 @@ def figures_2d_of_pixelization(
pass

if signal_to_noise_map:

try:

signal_to_noise_values = self.inversion.reconstruction_dict[mapper_plotter.mapper] / self.inversion.errors_dict[mapper_plotter.mapper]
signal_to_noise_values = (
self.inversion.reconstruction_dict[mapper_plotter.mapper]
/ self.inversion.errors_dict[mapper_plotter.mapper]
)

mapper_plotter.plot_source_from(
pixel_values=signal_to_noise_values,
auto_labels=AutoLabels(title="Signal To Noise Map", filename="signal_to_noise_map"),
auto_labels=AutoLabels(
title="Signal To Noise Map", filename="signal_to_noise_map"
),
)

except TypeError:
Expand Down
7 changes: 4 additions & 3 deletions autoarray/mask/abstract_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,15 @@ def pixel_scale(self) -> float:
"""
for pixel_scale in self.pixel_scales:
if abs(pixel_scale - self.pixel_scales[0]) > 1.0e-8:

logger.warning(f"""
logger.warning(
f"""
The Mask has different pixel scales in each dimensions, which are {self.pixel_scales}.
This is not expected, and will lead to unexpected behaviour in the grid and mask classes.
The code will continue to run, but you should check that the pixel scales are as you expect and
that associated data structures (e.g. grids) are behaving as you expect.
""")
"""
)

return self.pixel_scales[0]

Expand Down
7 changes: 5 additions & 2 deletions autoarray/structures/grids/irregular_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

logger = logging.getLogger(__name__)


class Grid2DIrregular(AbstractNDArray):
def __init__(self, values: Union[np.ndarray, List]):
"""
Expand Down Expand Up @@ -353,11 +354,13 @@ def pixel_scale(self) -> float:
if self.pixel_scales[0] == self.pixel_scales[1]:
return self.pixel_scales[0]
else:
logger.warning(f"""
logger.warning(
f"""
The `Grid2DIrregular` has pixel scales of {self.pixel_scales}, which are not the same in both
dimensions. This means that the pixel scale of the grid is not a single value and may cause
issues with calculations that assume a uniform pixel scale.
""")
"""
)

@classmethod
def from_grid_sparse_uniform_upscale(
Expand Down

0 comments on commit f482e4e

Please sign in to comment.