Skip to content

Commit c3e4ce3

Browse files
Jammy2211Jammy2211
authored andcommitted
black and minor fixes
1 parent 3820704 commit c3e4ce3

File tree

22 files changed

+103
-91
lines changed

22 files changed

+103
-91
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
uses: actions/setup-python@v4
2323
with:
2424
python-version: ${{ matrix.python-version }}
25-
- uses: actions/cache@v2
25+
- uses: actions/cache@v3
2626
id: cache-pip
2727
with:
2828
path: ~/.cache/pip
@@ -36,9 +36,9 @@ jobs:
3636
pip3 install setuptools
3737
pip3 install wheel
3838
pip3 install pytest coverage pytest-cov
39-
pip3 install -r PyAutoConf/requirements.txt
40-
pip3 install -r PyAutoArray/requirements.txt
41-
pip3 install -r PyAutoArray/optional_requirements.txt
39+
pip install ./PyAutoConf
40+
pip install ./PyAutoArray
41+
pip install ./PyAutoArray[optional]
4242
4343
cd PyAutoArray/autoarray/util/nn/src/nn
4444
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/runner/work/PyAutoArray/PyAutoArray/PyAutoArray/autoarray/util/nn/src/nn

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/inversion/inversion/abstract.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,6 @@ def mapper_zero_pixel_list(self) -> np.ndarray:
446446
)
447447
return mapper_zero_pixel_list
448448

449-
450449
@cached_property
451450
@profile_func
452451
def reconstruction(self) -> np.ndarray:

autoarray/inversion/pixelization/mappers/abstract.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,9 @@ def extent_from(
397397
zoom_to_brightest: bool = True,
398398
zoom_percent: Optional[float] = None,
399399
) -> Tuple[float, float, float, float]:
400+
401+
from autoarray.geometry import geometry_util
402+
400403
if zoom_to_brightest and values is not None:
401404
if zoom_percent is None:
402405
zoom_percent = conf.instance["visualize"]["general"]["zoom"][
@@ -408,8 +411,6 @@ def extent_from(
408411
true_indices = np.argwhere(fractional_bool)
409412
true_grid = self.source_plane_mesh_grid[true_indices]
410413

411-
from autoarray.geometry import geometry_util
412-
413414
try:
414415
return geometry_util.extent_symmetric_from(
415416
extent=(
@@ -420,9 +421,13 @@ def extent_from(
420421
)
421422
)
422423
except ValueError:
423-
return self.source_plane_mesh_grid.geometry.extent
424+
return geometry_util.extent_symmetric_from(
425+
extent=self.source_plane_mesh_grid.geometry.extent
426+
)
424427

425-
return self.source_plane_mesh_grid.geometry.extent
428+
return geometry_util.extent_symmetric_from(
429+
extent=self.source_plane_mesh_grid.geometry.extent
430+
)
426431

427432
def interpolated_array_from(
428433
self,

autoarray/mask/derive/zoom_2d.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,9 @@ def array_2d_rgb_from(self, array: Array2DRGB, buffer: int = 1) -> Array2DRGB:
302302
)
303303

304304
if i == 0:
305-
array_2d_rgb = np.zeros((extracted_array_2d.shape[0], extracted_array_2d.shape[1], 3))
305+
array_2d_rgb = np.zeros(
306+
(extracted_array_2d.shape[0], extracted_array_2d.shape[1], 3)
307+
)
306308

307309
array_2d_rgb[:, :, i] = extracted_array_2d
308310

@@ -320,4 +322,4 @@ def array_2d_rgb_from(self, array: Array2DRGB, buffer: int = 1) -> Array2DRGB:
320322
origin=array.mask.mask_centre,
321323
)
322324

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

autoarray/plot/mat_plot/two_d.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,7 @@ def plot_array(
257257
"a pixel scales attribute."
258258
)
259259

260-
if conf.instance["visualize"]["general"]["general"][
261-
"zoom_around_mask"
262-
]:
260+
if conf.instance["visualize"]["general"]["general"]["zoom_around_mask"]:
263261

264262
zoom = Zoom2D(mask=array.mask)
265263

@@ -303,7 +301,6 @@ def plot_array(
303301
origin=origin,
304302
)
305303

306-
307304
if visuals_2d.array_overlay is not None:
308305
self.array_overlay.overlay_array(
309306
array=visuals_2d.array_overlay, figure=self.figure

autoarray/plot/wrap/base/units.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def __init__(
1515
ticks_label: Optional[str] = None,
1616
colorbar_convert_factor: Optional[float] = None,
1717
colorbar_label: Optional[str] = None,
18-
**kwargs
18+
**kwargs,
1919
):
2020
"""
2121
This object controls the units of a plotted figure, and performs multiple tasks when making the plot:

autoarray/plot/wrap/one_d/yx_plot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def plot_y_vs_x(
7272
# marker="o",
7373
fmt="o",
7474
# ls=ls_errorbar,
75-
**self.config_dict
75+
**self.config_dict,
7676
)
7777
if plot_axis_type == "errorbar_logy":
7878
plt.yscale("log")

autoarray/plot/wrap/two_d/array_overlay.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ def overlay_array(self, array, figure):
2323
array_zoom = zoom.array_2d_from(array=array, buffer=0)
2424
extent = array_zoom.geometry.extent
2525

26-
plt.imshow(X=array.native, aspect=aspect, extent=extent, **self.config_dict)
26+
plt.imshow(X=array.native, aspect=aspect, extent=extent, **self.config_dict)

autoarray/plot/wrap/two_d/delaunay_drawer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,5 @@ def draw_delaunay_pixels(
112112
cmap=cmap,
113113
vmin=vmin,
114114
vmax=vmax,
115-
**self.config_dict
115+
**self.config_dict,
116116
)

0 commit comments

Comments
 (0)