Skip to content

Commit ec5ed6f

Browse files
Jammy2211Jammy2211
authored andcommitted
remove edge_pixel_list throughotu soruce code
1 parent 12be2c1 commit ec5ed6f

6 files changed

Lines changed: 0 additions & 73 deletions

File tree

autoarray/inversion/inversion/abstract.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -200,33 +200,6 @@ def all_linear_obj_have_regularization(self) -> bool:
200200
list(filter(None, self.regularization_list))
201201
)
202202

203-
@property
204-
def mapper_edge_pixel_list(self) -> List[int]:
205-
"""
206-
Returns the edge pixels of all mappers in the inversion.
207-
208-
This uses the `edge_pixel_list` property of the `Mesh` of the `Mapper` class, and updates their values to
209-
correspond to the indexing of the overall inversion's `curvature_matrix`.
210-
211-
This is used to regulareze the edge pixels of the inversion's `reconstruction` or remove them from the
212-
inversion procedure entirely (e.g. make these values of these edge pixels zero).
213-
214-
Returns
215-
-------
216-
A list of the edge pixels of all mappers in the inversion, where the values are updated to correspond to the
217-
indexing of the overall inversion's `curvature_matrix`.
218-
"""
219-
mapper_edge_pixel_list = []
220-
221-
param_range_list = self.param_range_list_from(cls=LinearObj)
222-
223-
for param_range, linear_obj in zip(param_range_list, self.linear_obj_list):
224-
if isinstance(linear_obj, AbstractMapper):
225-
for edge_pixel in linear_obj.edge_pixel_list:
226-
mapper_edge_pixel_list.append(edge_pixel + param_range[0])
227-
228-
return mapper_edge_pixel_list
229-
230203
@property
231204
def total_regularizations(self) -> int:
232205
return sum(

autoarray/inversion/mock/mock_mapper.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ def __init__(
1414
over_sampler=None,
1515
border_relocator=None,
1616
adapt_data=None,
17-
edge_pixel_list=None,
1817
regularization=None,
1918
pix_sub_weights=None,
2019
pix_sub_weights_split_points=None,
@@ -37,7 +36,6 @@ def __init__(
3736
)
3837

3938
self._over_sampler = over_sampler
40-
self._edge_pixel_list = edge_pixel_list
4139
self._pix_sub_weights = pix_sub_weights
4240
self._pix_sub_weights_split_points = pix_sub_weights_split_points
4341
self._mapping_matrix = mapping_matrix
@@ -62,10 +60,6 @@ def over_sampler(self):
6260
return super().over_sampler
6361
return self._over_sampler
6462

65-
@property
66-
def edge_pixel_list(self):
67-
return self._edge_pixel_list
68-
6963
@property
7064
def pix_sub_weights(self):
7165
return self._pix_sub_weights

autoarray/inversion/pixelization/mappers/abstract.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,6 @@ def image_plane_mesh_grid(self) -> Grid2D:
113113
def over_sampler(self):
114114
return self.mapper_grids.source_plane_data_grid.over_sampler
115115

116-
@property
117-
def edge_pixel_list(self) -> List[int]:
118-
return self.source_plane_mesh_grid.edge_pixel_list
119-
120116
@property
121117
def adapt_data(self) -> np.ndarray:
122118
return self.mapper_grids.adapt_data

autoarray/inversion/pixelization/mesh/mesh_numba_util.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -122,24 +122,3 @@ def delaunay_interpolated_array_from(
122122
interpolated_array[slim_index] = np.sum(weight_abc * triangle_values)
123123

124124
return interpolated_array.reshape(shape_native)
125-
126-
127-
def voronoi_edge_pixels_from(regions: np.ndarray, point_region: np.ndarray) -> List:
128-
"""
129-
Returns the edge pixels of a Voronoi mesh, where the edge pixels are defined as those pixels which are on the
130-
edge of the Voronoi diagram.
131-
132-
Parameters
133-
----------
134-
regions
135-
Indices of the Voronoi vertices forming each Voronoi region, where -1 indicates vertex outside the Voronoi
136-
diagram.
137-
"""
138-
139-
voronoi_edge_pixel_list = []
140-
141-
for index, i in enumerate(point_region):
142-
if -1 in regions[i]:
143-
voronoi_edge_pixel_list.append(index)
144-
145-
return voronoi_edge_pixel_list

autoarray/structures/mesh/delaunay_2d.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -439,15 +439,6 @@ def voronoi(self) -> "scipy.spatial.Voronoi":
439439
except (ValueError, OverflowError, QhullError) as e:
440440
raise exc.MeshException() from e
441441

442-
@property
443-
def edge_pixel_list(self) -> List:
444-
"""
445-
Returns a list of the Voronoi pixel indexes that are on the edge of the mesh.
446-
"""
447-
return mesh_numba_util.voronoi_edge_pixels_from(
448-
regions=self.voronoi.regions, point_region=self.voronoi.point_region
449-
)
450-
451442
def interpolated_array_from(
452443
self,
453444
values: np.ndarray,

autoarray/structures/mesh/rectangular_2d.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,6 @@ def neighbors(self) -> Neighbors:
129129

130130
return Neighbors(arr=neighbors.astype("int"), sizes=sizes.astype("int"))
131131

132-
@property
133-
def edge_pixel_list(self) -> List:
134-
return mesh_util.rectangular_edge_pixel_list_from(
135-
shape_native=self.shape_native
136-
)
137-
138132
@property
139133
def pixels(self) -> int:
140134
"""

0 commit comments

Comments
 (0)