Skip to content

Commit

Permalink
update type hint
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago committed Sep 22, 2023
1 parent 5f4eb8d commit 3775316
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion rio_tiler/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import numpy
from affine import Affine
from color_operations import parse_operations, scale_dtype, to_math_type
from numpy.typing import NDArray
from pydantic import BaseModel
from rasterio import windows
from rasterio.coords import BoundingBox
Expand Down Expand Up @@ -796,7 +797,7 @@ def get_coverage_array(
shape: Dict,
shape_crs: CRS = WGS84_CRS,
cover_scale: int = 10,
) -> numpy.array:
) -> NDArray[numpy.floating]:

"""
cover_scale: int, optional
Expand Down
4 changes: 3 additions & 1 deletion rio_tiler/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import numpy
import rasterio
from affine import Affine
from numpy.typing import NDArray
from rasterio import windows
from rasterio.crs import CRS
from rasterio.dtypes import _gdal_typename
Expand Down Expand Up @@ -36,7 +37,7 @@ def get_array_statistics(
categorical: bool = False,
categories: Optional[List[float]] = None,
percentiles: Optional[List[int]] = None,
coverage: Optional[numpy.ndarray] = None,
coverage: Optional[NDArray[numpy.floating]] = None,
**kwargs: Any,
) -> List[Dict[Any, Any]]:
"""Calculate per band array statistics.
Expand All @@ -46,6 +47,7 @@ def get_array_statistics(
categorical (bool): treat input data as categorical data. Defaults to `False`.
categories (list of numbers, optional): list of categories to return value for.
percentiles (list of numbers, optional): list of percentile values to calculate. Defaults to `[2, 98]`.
coverage (numpy.array, optional): Data coverage fraction.
kwargs (optional): options to forward to `numpy.histogram` function (only applies for non-categorical data).
Returns:
Expand Down

0 comments on commit 3775316

Please sign in to comment.