Skip to content

Commit 4cc87d4

Browse files
Jammy2211Jammy2211
authored andcommitted
refactor going well bout to do one final change on new branch
1 parent 723111c commit 4cc87d4

File tree

4 files changed

+21
-17
lines changed

4 files changed

+21
-17
lines changed

autoarray/inversion/pixelization/interpolator/delaunay.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -424,15 +424,7 @@ def delaunay(self) -> "scipy.spatial.Delaunay":
424424
`MeshException`, which helps exception handling in the `inversion` package.
425425
"""
426426

427-
if self.preloads is not None:
428-
429-
skip_areas = self.preloads.skip_areas
430-
431-
else:
432-
433-
skip_areas = False
434-
435-
if not skip_areas:
427+
if not self.mesh.skip_areas:
436428

437429
if self._xp.__name__.startswith("jax"):
438430

autoarray/inversion/pixelization/mesh/delaunay.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ def __init__(self, areas_factor: float = 0.5):
3737
super().__init__()
3838
self.areas_factor = areas_factor
3939

40+
@property
41+
def skip_areas(self):
42+
"""
43+
Whether to skip barycentric area calculations and split point computations during Delaunay triangulation.
44+
When True, the Delaunay interface returns only the minimal set of outputs (points, simplices, mappings)
45+
without computing split_points or splitted_mappings. This optimization is useful for regularization
46+
schemes like Matérn kernels that don't require area-based calculations. Default is False.
47+
"""
48+
return False
49+
4050
@property
4151
def mapper_cls(self):
4252

autoarray/inversion/pixelization/mesh/knn.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ def __init__(
1818

1919
super().__init__()
2020

21+
@property
22+
def skip_areas(self):
23+
"""
24+
Whether to skip barycentric area calculations and split point computations during Delaunay triangulation.
25+
When True, the Delaunay interface returns only the minimal set of outputs (points, simplices, mappings)
26+
without computing split_points or splitted_mappings. This optimization is useful for regularization
27+
schemes like Matérn kernels that don't require area-based calculations. Default is False.
28+
"""
29+
return False
30+
2131
@property
2232
def mapper_cls(self):
2333

autoarray/preloads.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ def __init__(
2424
source_pixel_zeroed_indices: np.ndarray = None,
2525
image_plane_mesh_grid_list: np.ndarray = None,
2626
linear_light_profile_blurred_mapping_matrix=None,
27-
skip_areas: bool = False,
2827
):
2928
"""
3029
Stores preloaded arrays and matrices used during pixelized linear inversions, improving both performance
@@ -80,11 +79,6 @@ def __init__(
8079
inversion, with the other component being the pixelization's pixels. These are fixed when the lens light
8180
is fixed to the maximum likelihood solution, allowing the blurred mapping matrix to be preloaded, but
8281
the intensity values will still be solved for during the inversion.
83-
skip_areas
84-
Whether to skip Voronoi area calculations and split point computations during Delaunay triangulation.
85-
When True, the Delaunay interface returns only the minimal set of outputs (points, simplices, mappings)
86-
without computing split_points or splitted_mappings. This optimization is useful for regularization
87-
schemes like Matérn kernels that don't require area-based calculations. Default is False.
8882
"""
8983
self.mapper_indices = None
9084
self.source_pixel_zeroed_indices = None
@@ -124,5 +118,3 @@ def __init__(
124118
self.linear_light_profile_blurred_mapping_matrix = np.array(
125119
linear_light_profile_blurred_mapping_matrix
126120
)
127-
128-
self.skip_areas = skip_areas

0 commit comments

Comments
 (0)