Skip to content

Commit 473dc10

Browse files
Jammy2211Jammy2211
authored andcommitted
black
1 parent c488f38 commit 473dc10

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

autoarray/fixtures.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ def make_array_1d_7():
6767
def make_array_2d_7x7():
6868
return aa.Array2D.ones(shape_native=(7, 7), pixel_scales=(1.0, 1.0))
6969

70+
7071
def make_array_2d_rgb_7x7():
7172
return aa.Array2DRGB(values=np.ones((7, 7, 3)), mask=make_mask_2d_7x7())
7273

autoarray/mask/derive/zoom_2d.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,17 +296,19 @@ def array_2d_rgb_from(self, array: Array2DRGB, buffer: int = 1) -> Array2DRGB:
296296
for i in range(3):
297297

298298
extracted_array_2d = array_2d_util.extracted_array_2d_from(
299-
array_2d=np.array(array.native[:,:,i]),
299+
array_2d=np.array(array.native[:, :, i]),
300300
y0=self.region[0] - buffer,
301301
y1=self.region[1] + buffer,
302302
x0=self.region[2] - buffer,
303303
x1=self.region[3] + buffer,
304304
)
305305

306306
if i == 0:
307-
array_2d_rgb = np.zeros((extracted_array_2d.shape[0], extracted_array_2d.shape[1], 3))
307+
array_2d_rgb = np.zeros(
308+
(extracted_array_2d.shape[0], extracted_array_2d.shape[1], 3)
309+
)
308310

309-
array_2d_rgb[:,:,i] = extracted_array_2d
311+
array_2d_rgb[:, :, i] = extracted_array_2d
310312

311313
extracted_mask_2d = array_2d_util.extracted_array_2d_from(
312314
array_2d=np.array(self.mask),
@@ -322,4 +324,4 @@ def array_2d_rgb_from(self, array: Array2DRGB, buffer: int = 1) -> Array2DRGB:
322324
origin=array.mask.mask_centre,
323325
)
324326

325-
return Array2DRGB(values=array_2d_rgb.astype("int"), mask=mask)
327+
return Array2DRGB(values=array_2d_rgb.astype("int"), mask=mask)

autoarray/structures/arrays/rgb.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from autoarray.abstract_ndarray import AbstractNDArray
22
from autoarray.structures.arrays.uniform_2d import Array2D
33

4+
45
class Array2DRGB(Array2D):
56

67
def __init__(self, values, mask):
@@ -41,4 +42,4 @@ def native(self) -> "Array2D":
4142
"""
4243
Returns the RGB ndarray of shape [total_y_pixels, total_x_pixels, 3] in its `native` representation.
4344
"""
44-
return self
45+
return self

test_autoarray/structures/plot/test_structure_plotters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,4 +183,4 @@ def test__array_rgb(
183183

184184
array_plotter.figure_2d()
185185

186-
assert path.join(plot_path, "array_rgb.png") in plot_patch.paths
186+
assert path.join(plot_path, "array_rgb.png") in plot_patch.paths

0 commit comments

Comments
 (0)