Commit 2ec15b05 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Added type hints.

parent a04bb76b
Pipeline #1175 passed with stages
in 10 minutes and 27 seconds
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
import warnings import warnings
import numpy as np import numpy as np
from shapely.geometry import box, Polygon from shapely.geometry import box, Polygon
from typing import TYPE_CHECKING, Union
from py_tools_ds.geo.coord_calc import get_corner_coordinates, calc_FullDataset_corner_positions from py_tools_ds.geo.coord_calc import get_corner_coordinates, calc_FullDataset_corner_positions
from py_tools_ds.geo.coord_grid import snap_bounds_to_pixGrid from py_tools_ds.geo.coord_grid import snap_bounds_to_pixGrid
from py_tools_ds.geo.coord_trafo import mapXY2imXY, transform_any_prj, imXY2mapXY from py_tools_ds.geo.coord_trafo import mapXY2imXY, transform_any_prj, imXY2mapXY
...@@ -13,9 +14,13 @@ from py_tools_ds.numeric.array import get_outFillZeroSaturated ...@@ -13,9 +14,13 @@ from py_tools_ds.numeric.array import get_outFillZeroSaturated
__author__ = 'Daniel Scheffler' __author__ = 'Daniel Scheffler'
if TYPE_CHECKING:
from .baseclasses import GeoArray
T_ndA_gA = Union[np.ndarray, GeoArray]
def _clip_array_at_mapPos(arr, mapBounds, arr_gt, band2clip=None, fillVal=0): def _clip_array_at_mapPos(arr, mapBounds, arr_gt, band2clip=None, fillVal=0):
# type: (any, tuple, tuple, int, int) -> (np.ndarray, tuple) # type: (T_ndA_gA, tuple, tuple, int, int) -> (np.ndarray, tuple)
""" """
NOTE: asserts that mapBounds have the same projection like the coordinates in arr_gt NOTE: asserts that mapBounds have the same projection like the coordinates in arr_gt
...@@ -173,7 +178,7 @@ def get_array_at_mapPosOLD(arr, arr_gt, arr_prj, mapBounds, mapBounds_prj, band2 ...@@ -173,7 +178,7 @@ def get_array_at_mapPosOLD(arr, arr_gt, arr_prj, mapBounds, mapBounds_prj, band2
def get_array_at_mapPos(arr, arr_gt, arr_prj, out_prj, mapBounds, mapBounds_prj=None, out_gsd=None, band2get=None, def get_array_at_mapPos(arr, arr_gt, arr_prj, out_prj, mapBounds, mapBounds_prj=None, out_gsd=None, band2get=None,
fillVal=0, rspAlg='near', progress=True): fillVal=0, rspAlg='near', progress=True):
# type: (any, tuple, str, str, tuple, str, tuple, int, int, str, bool) -> (np.ndarray, tuple, str) # type: (T_ndA_gA, tuple, str, str, tuple, str, tuple, int, int, str, bool) -> (np.ndarray, tuple, str)
""" """
:param arr: :param arr:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment