Skip to content

Commit 12be2c1

Browse files
Jammy2211Jammy2211
authored andcommitted
pure callback now starting to look readable
1 parent 131ebd9 commit 12be2c1

17 files changed

Lines changed: 193 additions & 338 deletions

File tree

autoarray/fixtures.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ def make_delaunay_mesh_grid_9():
380380

381381
return aa.Mesh2DDelaunay(values=grid_9)
382382

383+
383384
def make_over_sampler_2d_7x7():
384385
return aa.OverSampler(mask=make_mask_2d_7x7(), sub_size=2)
385386

@@ -421,6 +422,7 @@ def make_delaunay_mapper_9_3x3():
421422
regularization=make_regularization_constant(),
422423
)
423424

425+
424426
def make_rectangular_inversion_7x7_3x3():
425427
return aa.Inversion(
426428
dataset=make_masked_imaging_7x7(),
@@ -434,6 +436,7 @@ def make_delaunay_inversion_9_3x3():
434436
linear_obj_list=[make_delaunay_mapper_9_3x3()],
435437
)
436438

439+
437440
### EUCLID DATA ####
438441

439442

autoarray/inversion/mock/mock_mapper.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def __init__(
1717
edge_pixel_list=None,
1818
regularization=None,
1919
pix_sub_weights=None,
20-
pix_sub_weights_split_cross=None,
20+
pix_sub_weights_split_points=None,
2121
mapping_matrix=None,
2222
pixel_signals=None,
2323
parameters=None,
@@ -39,7 +39,7 @@ def __init__(
3939
self._over_sampler = over_sampler
4040
self._edge_pixel_list = edge_pixel_list
4141
self._pix_sub_weights = pix_sub_weights
42-
self._pix_sub_weights_split_cross = pix_sub_weights_split_cross
42+
self._pix_sub_weights_split_points = pix_sub_weights_split_points
4343
self._mapping_matrix = mapping_matrix
4444
self._parameters = parameters
4545
self._pixel_signals = pixel_signals
@@ -71,8 +71,8 @@ def pix_sub_weights(self):
7171
return self._pix_sub_weights
7272

7373
@property
74-
def pix_sub_weights_split_cross(self):
75-
return self._pix_sub_weights_split_cross
74+
def pix_sub_weights_split_points(self):
75+
return self._pix_sub_weights_split_points
7676

7777
@property
7878
def mapping_matrix(self):

autoarray/inversion/pixelization/mappers/delaunay.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
from autoarray.inversion.pixelization.mappers.abstract import PixSubWeights
77

88

9-
10-
11-
129
def triangle_area_xp(c0, c1, c2, xp):
1310
"""
1411
Twice triangle area using vector cross product magnitude.
@@ -201,7 +198,7 @@ def pix_sub_weights(self) -> PixSubWeights:
201198
return PixSubWeights(mappings=mappings, sizes=sizes, weights=weights)
202199

203200
@property
204-
def pix_sub_weights_split_cross(self) -> PixSubWeights:
201+
def pix_sub_weights_split_points(self) -> PixSubWeights:
205202
"""
206203
The property `pix_sub_weights` property describes the calculation of the `PixSubWeights` object, which contains
207204
numpy arrays describing how data-points and mapper pixels map to one another and the weights of these mappings.
@@ -216,7 +213,7 @@ def pix_sub_weights_split_cross(self) -> PixSubWeights:
216213
delaunay = self.delaunay
217214

218215
splitted_weights = pixel_weights_delaunay_from(
219-
source_plane_data_grid=delaunay.split_cross,
216+
source_plane_data_grid=delaunay.split_points,
220217
source_plane_mesh_grid=self.source_plane_mesh_grid.array,
221218
pix_indexes_for_sub_slim_index=delaunay.splitted_mappings.astype("int"),
222219
xp=self._xp,

autoarray/inversion/pixelization/mappers/mapper_numba_util.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,3 @@ def data_slim_to_pixelization_unique_from(
103103
pix_lengths[ip] = pix_size
104104

105105
return data_to_pix_unique, data_weights, pix_lengths
106-

autoarray/inversion/pixelization/mesh/delaunay.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from autoarray.structures.grids.uniform_2d import Grid2D
99
from autoarray.structures.grids.irregular_2d import Grid2DIrregular
1010

11+
1112
class Delaunay(AbstractMesh):
1213
def __init__(self):
1314
"""
@@ -58,7 +59,11 @@ def mesh_grid_from(
5859
Settings controlling the pixelization for example if a border is used to relocate its exterior coordinates.
5960
"""
6061

61-
return Mesh2DDelaunay(values=source_plane_mesh_grid, source_plane_data_grid_over_sampled=source_plane_data_grid, _xp=xp)
62+
return Mesh2DDelaunay(
63+
values=source_plane_mesh_grid,
64+
source_plane_data_grid_over_sampled=source_plane_data_grid,
65+
_xp=xp,
66+
)
6267

6368
def mapper_grids_from(
6469
self,
@@ -138,4 +143,4 @@ def mapper_grids_from(
138143
source_plane_mesh_grid=source_plane_mesh_grid,
139144
image_plane_mesh_grid=image_plane_mesh_grid,
140145
adapt_data=adapt_data,
141-
)
146+
)

autoarray/inversion/pixelization/mesh/mesh_numba_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,4 +142,4 @@ def voronoi_edge_pixels_from(regions: np.ndarray, point_region: np.ndarray) -> L
142142
if -1 in regions[i]:
143143
voronoi_edge_pixel_list.append(index)
144144

145-
return voronoi_edge_pixel_list
145+
return voronoi_edge_pixel_list

autoarray/inversion/regularization/adaptive_brightness_split.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,16 @@ def regularization_matrix_from(self, linear_obj: LinearObj, xp=np) -> np.ndarray
9494
linear_obj=linear_obj, xp=xp
9595
)
9696

97-
pix_sub_weights_split_cross = linear_obj.pix_sub_weights_split_cross
97+
pix_sub_weights_split_points = linear_obj.pix_sub_weights_split_points
9898

9999
(
100100
splitted_mappings,
101101
splitted_sizes,
102102
splitted_weights,
103103
) = regularization_util.reg_split_from(
104-
splitted_mappings=pix_sub_weights_split_cross.mappings,
105-
splitted_sizes=pix_sub_weights_split_cross.sizes,
106-
splitted_weights=pix_sub_weights_split_cross.weights,
104+
splitted_mappings=pix_sub_weights_split_points.mappings,
105+
splitted_sizes=pix_sub_weights_split_points.sizes,
106+
splitted_weights=pix_sub_weights_split_points.weights,
107107
xp=xp,
108108
)
109109

autoarray/inversion/regularization/adaptive_brightness_split_zeroth.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,16 @@ def regularization_matrix_from(self, linear_obj: LinearObj, xp=np) -> np.ndarray
9696
linear_obj=linear_obj, xp=xp
9797
)
9898

99-
pix_sub_weights_split_cross = linear_obj.pix_sub_weights_split_cross
99+
pix_sub_weights_split_points = linear_obj.pix_sub_weights_split_points
100100

101101
(
102102
splitted_mappings,
103103
splitted_sizes,
104104
splitted_weights,
105105
) = regularization_util.reg_split_from(
106-
splitted_mappings=pix_sub_weights_split_cross.mappings,
107-
splitted_sizes=pix_sub_weights_split_cross.sizes,
108-
splitted_weights=pix_sub_weights_split_cross.weights,
106+
splitted_mappings=pix_sub_weights_split_points.mappings,
107+
splitted_sizes=pix_sub_weights_split_points.sizes,
108+
splitted_weights=pix_sub_weights_split_points.weights,
109109
xp=xp,
110110
)
111111

autoarray/inversion/regularization/constant_split.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,16 @@ def regularization_matrix_from(self, linear_obj: LinearObj, xp=np) -> np.ndarray
5656
-------
5757
The regularization matrix.
5858
"""
59-
pix_sub_weights_split_cross = linear_obj.pix_sub_weights_split_cross
59+
pix_sub_weights_split_points = linear_obj.pix_sub_weights_split_points
6060

6161
(
6262
splitted_mappings,
6363
splitted_sizes,
6464
splitted_weights,
6565
) = regularization_util.reg_split_from(
66-
splitted_mappings=pix_sub_weights_split_cross.mappings,
67-
splitted_sizes=pix_sub_weights_split_cross.sizes,
68-
splitted_weights=pix_sub_weights_split_cross.weights,
66+
splitted_mappings=pix_sub_weights_split_points.mappings,
67+
splitted_sizes=pix_sub_weights_split_points.sizes,
68+
splitted_weights=pix_sub_weights_split_points.weights,
6969
xp=xp,
7070
)
7171

autoarray/plot/mat_plot/two_d.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,4 +738,3 @@ def _plot_delaunay_mapper(
738738
structure=interpolation_array, auto_filename=auto_labels.filename
739739
)
740740
self.figure.close()
741-

0 commit comments

Comments
 (0)