Skip to content

Commit

Permalink
Finalizing comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rhugonnet committed Aug 5, 2024
1 parent 093c0b7 commit d905d18
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions geoutils/raster/interpolate.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def _interpn_interpolator(
mask_nan = ~np.isfinite(values)
if d != 0:
new_mask = binary_dilation(mask_nan, iterations=d).astype("uint8")
# Zero iterations has a specific behaviour in binary_dilation, here we just want the origina array
# Zero iterations has a different behaviour in binary_dilation than doing nothing, here we want the original array
else:
new_mask = mask_nan.astype("uint8")

Expand All @@ -92,6 +92,7 @@ def regulargrid_interpolator_with_nan(xi: tuple[NDArrayNum, NDArrayNum]) -> NDAr

results = interp(xi)

# If NaNs are not supported
if True:
invalids = interp_mask(xi)
results[invalids.astype(bool)] = np.nan
Expand Down Expand Up @@ -160,7 +161,7 @@ def _map_coordinates_nodata_propag(
mask_nan = ~np.isfinite(values)
if d != 0:
new_mask = binary_dilation(mask_nan, iterations=d).astype("uint8")
# Zero iterations has a specific behaviour in binary_dilation, here we just want the origina array
# Zero iterations has a different behaviour in binary_dilation than doing nothing, here we want the original array
else:
new_mask = mask_nan.astype("uint8")

Expand Down

0 comments on commit d905d18

Please sign in to comment.