Skip to content

Commit

Permalink
Replace old AnyNumber with new Number from geoutils
Browse files Browse the repository at this point in the history
  • Loading branch information
rhugonnet committed Aug 14, 2023
1 parent 4d49209 commit c9a8d87
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions xdem/coreg/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import scipy.ndimage
import scipy.optimize
import skimage.transform
from geoutils._typing import AnyNumber
from geoutils._typing import Number
from geoutils.raster import (
Mask,
RasterType,
Expand Down Expand Up @@ -201,7 +201,7 @@ def _mask_dataframe_by_dem(df: pd.DataFrame | NDArrayf, dem: RasterType) -> pd.D
def _calculate_ddem_stats(
ddem: NDArrayf | MArrayf,
inlier_mask: NDArrayf | None = None,
stats_list: tuple[Callable[[NDArrayf], AnyNumber], ...] | None = None,
stats_list: tuple[Callable[[NDArrayf], Number], ...] | None = None,
stats_labels: tuple[str, ...] | None = None,
) -> dict[str, float]:
"""
Expand Down
14 changes: 7 additions & 7 deletions xdem/coreg/pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import numpy as np
import pandas as pd
import rasterio as rio
from geoutils._typing import AnyNumber
from geoutils._typing import Number
from geoutils.raster import RasterType

from xdem._typing import NDArrayf
Expand All @@ -24,9 +24,9 @@ def create_inlier_mask(
shp_list: list[str | gu.Vector | None] | tuple[str | gu.Vector] | tuple[()] = (),
inout: list[int] | tuple[int] | tuple[()] = (),
filtering: bool = True,
dh_max: AnyNumber = None,
nmad_factor: AnyNumber = 5,
slope_lim: list[AnyNumber] | tuple[AnyNumber, AnyNumber] = (0.1, 40),
dh_max: Number = None,
nmad_factor: Number = 5,
slope_lim: list[Number] | tuple[Number, Number] = (0.1, 40),
) -> NDArrayf:
"""
Create a mask of inliers pixels to be used for coregistration. The following pixels can be excluded:
Expand Down Expand Up @@ -135,9 +135,9 @@ def dem_coregistration(
shp_list: list[str | gu.Vector] | tuple[str | gu.Vector] | tuple[()] = (),
inout: list[int] | tuple[int] | tuple[()] = (),
filtering: bool = True,
dh_max: AnyNumber = None,
nmad_factor: AnyNumber = 5,
slope_lim: list[AnyNumber] | tuple[AnyNumber, AnyNumber] = (0.1, 40),
dh_max: Number = None,
nmad_factor: Number = 5,
slope_lim: list[Number] | tuple[Number, Number] = (0.1, 40),
plot: bool = False,
out_fig: str = None,
verbose: bool = False,
Expand Down

0 comments on commit c9a8d87

Please sign in to comment.