Skip to content

Commit 5f539ce

Browse files
Jammy2211Jammy2211
authored andcommitted
black
1 parent b4c0db4 commit 5f539ce

10 files changed

Lines changed: 19 additions & 21 deletions

File tree

autoarray/fit/fit_util.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,8 @@ def noise_normalization_complex_from(*, noise_map: jnp.ndarray) -> float:
174174
noise_map
175175
The masked noise-map of the dataset.
176176
"""
177-
noise_normalization_real = jnp.sum(
178-
jnp.log(2 * jnp.pi * noise_map.real ** 2.0)
179-
)
180-
noise_normalization_imag = jnp.sum(
181-
jnp.log(2 * jnp.pi * noise_map.imag ** 2.0)
182-
)
177+
noise_normalization_real = jnp.sum(jnp.log(2 * jnp.pi * noise_map.real**2.0))
178+
noise_normalization_imag = jnp.sum(jnp.log(2 * jnp.pi * noise_map.imag**2.0))
183179
return noise_normalization_real + noise_normalization_imag
184180

185181

autoarray/mask/derive/mask_2d.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,9 @@ def edge_buffed(self) -> Mask2D:
324324
"""
325325
from autoarray.mask.mask_2d import Mask2D
326326

327-
edge_buffed_mask = mask_2d_util.buffed_mask_2d_from(
328-
mask_2d=self.mask
329-
).astype("bool")
327+
edge_buffed_mask = mask_2d_util.buffed_mask_2d_from(mask_2d=self.mask).astype(
328+
"bool"
329+
)
330330

331331
return Mask2D(
332332
mask=edge_buffed_mask,

autoarray/mask/mask_1d.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ def from_fits(
153153
"""
154154

155155
return cls(
156-
mask=array_1d_util.numpy_array_1d_via_fits_from(file_path=file_path, hdu=hdu),
156+
mask=array_1d_util.numpy_array_1d_via_fits_from(
157+
file_path=file_path, hdu=hdu
158+
),
157159
pixel_scales=pixel_scales,
158160
origin=origin,
159161
)

autoarray/mask/mask_1d_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ def native_index_for_slim_index_1d_from(
3636

3737
if isinstance(mask_1d, np.ndarray):
3838
return np.flatnonzero(~mask_1d)
39-
return jnp.flatnonzero(~mask_1d)
39+
return jnp.flatnonzero(~mask_1d)

autoarray/plot/visuals/two_d.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ def plot_via_plotter(self, plotter, grid_indexes=None, mapper=None, geometry=Non
5555
)
5656

5757
if self.mask is not None:
58-
plotter.mask_scatter.scatter_grid(
59-
grid=self.mask.derive_grid.edge.array
60-
)
58+
plotter.mask_scatter.scatter_grid(grid=self.mask.derive_grid.edge.array)
6159

6260
if self.border is not None:
6361
plotter.border_scatter.scatter_grid(grid=self.border.array)

autoarray/plot/wrap/base/text.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ class Text(AbstractMatWrap):
99
1010
- plt.text: https://matplotlib.org/3.3.2/api/_as_gen/matplotlib.pyplot.text.html
1111
"""
12-
import matplotlib.pyplot as plt
1312

1413
def set(self):
14+
15+
import matplotlib.pyplot as plt
16+
1517
if "x" not in self.kwargs and "y" not in self.kwargs and "s" not in self.kwargs:
1618
return
1719

autoarray/structures/grids/grid_2d_util.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,9 @@ def grid_2d_slim_via_mask_from(
258258
pixel_scales = np.array(pixel_scales)
259259
sign = np.array([-1.0, 1.0])
260260
return (
261-
(np.stack(np.nonzero(~mask_2d.astype(bool))).T - centres_scaled)
262-
* sign
263-
* pixel_scales
261+
(np.stack(np.nonzero(~mask_2d.astype(bool))).T - centres_scaled)
262+
* sign
263+
* pixel_scales
264264
)
265265

266266
centres_scaled = jnp.array(centres_scaled)

autoarray/structures/mock/mock_decorators.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,5 +157,3 @@ def ndarray_yx_2d_list_from(self, grid, *args, **kwargs):
157157
Such functions are common in **PyAutoGalaxy** for light and mass profile objects.
158158
"""
159159
return [np.multiply(1.0, grid.array), np.multiply(2.0, grid.array)]
160-
161-

test_autoarray/conftest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import jax.numpy as jnp
22

3+
34
def pytest_configure():
45
_ = jnp.sum(jnp.array([0.0])) # Force backend init
56

7+
68
import os
79
from os import path
810
import pytest

test_autoarray/fit/test_fit_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ def test__log_likelihood_from__with_mask():
407407

408408

409409
def test__log_likelihood_from__complex_data():
410-
410+
411411
data = np.array([10.0 + 10.0j, 10.0 + 10.0j])
412412
noise_map = np.array([2.0 + 1.0j, 2.0 + 1.0j])
413413
model_data = np.array([9.0 + 12.0j, 9.0 + 12.0j])

0 commit comments

Comments
 (0)