@@ -11,27 +11,16 @@ class MapperKNNInterpolator(AbstractMapper):
1111 Mapper using kNN + compact Wendland kernel interpolation (partition of unity).
1212 """
1313
14- # ---- You almost certainly want these as configurable attributes somewhere ----
15- # If your Mesh / Pixelization already stores these, read them from self.mesh instead.
16- @property
17- def k_neighbors (self ) -> int :
18- # e.g. return self.pixelization.k_neighbors or self.mesh.k_neighbors
19- return getattr (self .pixelization , "k_neighbors" , 10 )
20-
21- @property
22- def kernel (self ) -> str :
23- return getattr (self .pixelization , "kernel" , "wendland_c4" )
24-
25- @property
26- def radius_scale (self ) -> float :
27- return getattr (self .pixelization , "radius_scale" , 1.5 )
28-
2914 def _pix_sub_weights_from_query_points (self , query_points ) -> PixSubWeights :
3015 """
3116 Compute PixSubWeights for arbitrary query points using the kNN kernel module.
3217 Arrays are created in self._xp (numpy or jax.numpy) from the start.
3318 """
3419
20+ k_neighbors = 10
21+ kernel = 'wendland_c4'
22+ radius_scale = 1.5
23+
3524 xp = self ._xp # numpy or jax.numpy
3625
3726 # ------------------------------------------------------------------
@@ -53,9 +42,9 @@ def _pix_sub_weights_from_query_points(self, query_points) -> PixSubWeights:
5342 weights_jax , indices_jax , _ = get_interpolation_weights (
5443 points = points ,
5544 query_points = query_points ,
56- k_neighbors = int (self . k_neighbors ),
57- kernel = self . kernel ,
58- radius_scale = float (self . radius_scale ),
45+ k_neighbors = int (k_neighbors ),
46+ kernel = kernel ,
47+ radius_scale = float (radius_scale ),
5948 )
6049
6150 # ------------------------------------------------------------------
0 commit comments