Skip to content

Commit a3015a3

Browse files
Jammy2211Jammy2211
authored andcommitted
all unit tests
1 parent 89f22e7 commit a3015a3

File tree

4 files changed

+14
-21
lines changed

4 files changed

+14
-21
lines changed

autoarray/inversion/mock/mock_image_mesh.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,3 @@ def __init__(self, image_plane_mesh_grid=None):
1212
super().__init__()
1313

1414
self.image_plane_mesh_grid = image_plane_mesh_grid
15-
16-
def image_plane_mesh_grid_from(
17-
self, mask: Mask2D, adapt_data: Optional[np.ndarray],
18-
) -> Grid2DIrregular:
19-
if adapt_data is not None and self.image_plane_mesh_grid is not None:
20-
return adapt_data * self.image_plane_mesh_grid
21-
22-
return self.image_plane_mesh_grid
23-
24-
@property
25-
def uses_adapt_images(self) -> bool:
26-
return False

autoarray/inversion/pixelization/image_mesh/hilbert.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,7 @@ def image_plane_mesh_grid_from(
288288
gridy=grid_hb[:, 0],
289289
)
290290

291-
mesh_grid = Grid2DIrregular(values=np.stack((drawn_y, drawn_x), axis=-1))
292-
293-
return mesh_grid
291+
return Grid2DIrregular(values=np.stack((drawn_y, drawn_x), axis=-1))
294292

295293
def check_mesh_pixels_per_image_pixels(
296294
self,

autoarray/preloads.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ def __init__(
107107
for image_plane_mesh_grid in image_plane_mesh_grid_list:
108108

109109
if image_plane_mesh_grid is not None:
110-
self.image_plane_mesh_grid_list.append(np.array(image_plane_mesh_grid))
110+
self.image_plane_mesh_grid_list.append(
111+
np.array(image_plane_mesh_grid)
112+
)
111113
else:
112114
self.image_plane_mesh_grid_list.append(None)
113115

test_autoarray/inversion/pixelization/image_mesh/test_abstract.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,28 +44,31 @@ def test__mesh_pixels_per_image_pixels_from(mask, mesh_grid, image_mesh):
4444

4545
def test__check_mesh_pixels_per_image_pixels(mask, mesh_grid, image_mesh):
4646
image_mesh.check_mesh_pixels_per_image_pixels(
47-
mask=mask, mesh_grid=mesh_grid,
47+
mask=mask,
48+
mesh_grid=mesh_grid,
4849
)
4950

5051
image_mesh.check_mesh_pixels_per_image_pixels(
5152
mask=mask,
5253
mesh_grid=mesh_grid,
5354
image_mesh_min_mesh_pixels_per_pixel=3,
54-
image_mesh_min_mesh_number=1
55+
image_mesh_min_mesh_number=1,
5556
)
5657

5758
with pytest.raises(aa.exc.InversionException):
5859
image_mesh.check_mesh_pixels_per_image_pixels(
5960
mask=mask,
6061
mesh_grid=mesh_grid,
61-
image_mesh_min_mesh_pixels_per_pixel=5, image_mesh_min_mesh_number=1
62+
image_mesh_min_mesh_pixels_per_pixel=5,
63+
image_mesh_min_mesh_number=1,
6264
)
6365

6466
with pytest.raises(aa.exc.InversionException):
6567
image_mesh.check_mesh_pixels_per_image_pixels(
6668
mask=mask,
6769
mesh_grid=mesh_grid,
68-
image_mesh_min_mesh_pixels_per_pixel=3, image_mesh_min_mesh_number=2
70+
image_mesh_min_mesh_pixels_per_pixel=3,
71+
image_mesh_min_mesh_number=2,
6972
)
7073

7174

@@ -76,7 +79,9 @@ def test__check_adapt_background_pixels(mask, mesh_grid, image_mesh):
7679
)
7780

7881
image_mesh.check_adapt_background_pixels(
79-
mask=mask, mesh_grid=mesh_grid, adapt_data=adapt_data,
82+
mask=mask,
83+
mesh_grid=mesh_grid,
84+
adapt_data=adapt_data,
8085
)
8186

8287
image_mesh.check_adapt_background_pixels(

0 commit comments

Comments
 (0)