@@ -460,7 +460,10 @@ def min_false_distance_to_edge(mask: np.ndarray) -> Tuple[int, int]:
460460 # Return the minimum distance to both edges
461461 return min (top_dist , bottom_dist ), min (left_dist , right_dist )
462462
463- def blurring_mask_2d_from (mask_2d : np .ndarray , kernel_shape_native : Tuple [int , int ]) -> np .ndarray :
463+
464+ def blurring_mask_2d_from (
465+ mask_2d : np .ndarray , kernel_shape_native : Tuple [int , int ]
466+ ) -> np .ndarray :
464467 """
465468 Return the blurring mask for a 2D mask and kernel footprint.
466469
@@ -474,7 +477,9 @@ def blurring_mask_2d_from(mask_2d: np.ndarray, kernel_shape_native: Tuple[int, i
474477
475478 ky , kx = kernel_shape_native
476479 if ky <= 0 or kx <= 0 :
477- raise ValueError (f"kernel_shape_native must be positive, got { kernel_shape_native } ." )
480+ raise ValueError (
481+ f"kernel_shape_native must be positive, got { kernel_shape_native } ."
482+ )
478483
479484 # Keep your existing guard (optional)
480485 y_distance , x_distance = min_false_distance_to_edge (mask_2d )
@@ -510,8 +515,8 @@ def blurring_mask_2d_from(mask_2d: np.ndarray, kernel_shape_native: Tuple[int, i
510515 blurring_region = mask_2d & near_unmasked # True on the ring (in region-space)
511516
512517 # Convert region -> mask semantics: ring should be unmasked (False)
513- blurring_mask = np .ones_like (mask_2d , dtype = bool ) # start fully masked
514- blurring_mask [blurring_region ] = False # unmask the ring
518+ blurring_mask = np .ones_like (mask_2d , dtype = bool ) # start fully masked
519+ blurring_mask [blurring_region ] = False # unmask the ring
515520
516521 return blurring_mask
517522
0 commit comments