@@ -154,7 +154,7 @@ def sub_is_uniform(self) -> bool:
154154 Returns True if the sub_size is uniform across all pixels in the mask.
155155 """
156156 return np .all (
157- np .isclose (self .sub_size . array , self .sub_size . array [0 ])
157+ np .isclose (self .sub_size , self .sub_size [0 ])
158158 )
159159
160160 def tree_flatten (self ):
@@ -233,12 +233,12 @@ def binned_array_2d_from(self, array: Array2D) -> "Array2D":
233233
234234 if self .sub_is_uniform :
235235 binned_array_2d = array .reshape (
236- self .mask .shape_slim , self .sub_size . array [0 ] ** 2
236+ self .mask .shape_slim , self .sub_size [0 ] ** 2
237237 ).mean (axis = 1 )
238238 else :
239239
240240 # Define group sizes
241- group_sizes = jnp .array (self .sub_size .array . astype ( "int" ) ** 2 )
241+ group_sizes = jnp .array (self .sub_size .array ** 2 )
242242
243243 # Compute the cumulative sum of group sizes to get split points
244244 split_indices = jnp .cumsum (group_sizes )
@@ -310,7 +310,7 @@ def sub_mask_native_for_sub_mask_slim(self) -> np.ndarray:
310310 print(derive_indexes_2d.sub_mask_native_for_sub_mask_slim)
311311 """
312312 return over_sample_util .native_sub_index_for_slim_sub_index_2d_from (
313- mask_2d = self .mask .array , sub_size = np . array ( self .sub_size )
313+ mask_2d = self .mask .array , sub_size = self .sub_size . array
314314 ).astype ("int" )
315315
316316 @cached_property
@@ -363,7 +363,7 @@ def slim_for_sub_slim(self) -> np.ndarray:
363363 print(derive_indexes_2d.slim_for_sub_slim)
364364 """
365365 return over_sample_util .slim_index_for_sub_slim_index_via_mask_2d_from (
366- mask_2d = np .array (self .mask ), sub_size = np . array ( self .sub_size )
366+ mask_2d = np .array (self .mask ), sub_size = self .sub_size . array
367367 ).astype ("int" )
368368
369369 @property
@@ -386,7 +386,7 @@ def uniform_over_sampled(self):
386386 grid = over_sample_util .grid_2d_slim_over_sampled_via_mask_from (
387387 mask_2d = np .array (self .mask ),
388388 pixel_scales = self .mask .pixel_scales ,
389- sub_size = np . array ( self .sub_size ) .astype ("int" ),
389+ sub_size = self .sub_size . array .astype ("int" ),
390390 origin = self .mask .origin ,
391391 )
392392
0 commit comments