@@ -645,7 +645,7 @@ def _preprocess_coreg_fit(
645
645
return ref_elev , tba_elev , inlier_mask , transform , crs
646
646
647
647
648
- def mask_array (arr : NDArrayf , nodata : int | float ):
648
+ def mask_array (arr : NDArrayf , nodata : int | float ) -> NDArrayf :
649
649
"""Convert invalid data to nan."""
650
650
return np .where (np .logical_or (~ da .isfinite (arr ), arr == nodata ), np .nan , arr )
651
651
@@ -718,7 +718,9 @@ def _postprocess_coreg_apply_pts(
718
718
return applied_elev
719
719
720
720
721
- def _postprocess_coreg_apply_xarray_xarray (applied_elev : da .Array , out_transform : affine .Affine ):
721
+ def _postprocess_coreg_apply_xarray_xarray (
722
+ applied_elev : da .Array , out_transform : affine .Affine
723
+ ) -> tuple [da .Array , affine .Affine ]:
722
724
"""Post-processing and checks of apply for dask inputs."""
723
725
724
726
# TODO mimic what is happening in the postprocess_coreg_apply_rst.
@@ -1332,9 +1334,12 @@ def _get_subsample_on_valid_mask(self, valid_mask: NDArrayb, verbose: bool = Fal
1332
1334
def _get_subsample_indices_dask (self , data : NDArrayb ) -> tuple [NDArrayf , NDArrayf ]:
1333
1335
"""Get subsampled indices from a dask array."""
1334
1336
1335
- # subsample value is handled in delyyed_subsample
1337
+ # subsample value is handled in delayed_subsample
1336
1338
indices = delayed_subsample (
1337
- darr = data , subsample = self ._meta ["subsample" ], return_indices = True , silence_max_subsample = True
1339
+ darr = data ,
1340
+ subsample = self ._meta ["subsample" ],
1341
+ return_indices = True ,
1342
+ silence_max_subsample = True ,
1338
1343
)
1339
1344
1340
1345
# Write final subsample to class
@@ -1906,7 +1911,7 @@ def _apply_func(self, **kwargs: Any) -> tuple[NDArrayf | gpd.GeoDataFrame, affin
1906
1911
"""Distribute to _apply_rst and _apply_pts based on input and method availability."""
1907
1912
1908
1913
# If input is a raster
1909
- if isinstance (kwargs ["elev" ], np .ndarray ):
1914
+ if isinstance (kwargs ["elev" ], ( np .ndarray , da . Array ) ):
1910
1915
1911
1916
# See if a _apply_rst exists
1912
1917
try :
0 commit comments