Skip to content

Commit

Permalink
MNT: Rename types based on python's convention. [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
Taher Chegini committed Jan 18, 2025
1 parent 746704d commit 62a0870
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/pynldas2/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@
from pyproj import Transformer
from pyproj.exceptions import CRSError as ProjCRSError
from rioxarray.exceptions import OneDimensionalRaster
from shapely import MultiPolygon, Polygon, ops
from shapely import Polygon, ops

from pynldas2.exceptions import DownloadError, InputRangeError, InputTypeError

if TYPE_CHECKING:
from numpy.typing import NDArray
from shapely import Polygon

CRSType = int | str | pyproj.CRS
PolyType = Polygon | tuple[float, float, float, float]
Expand Down
12 changes: 6 additions & 6 deletions src/pynldas2/pynldas2.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import re
import warnings
from pathlib import Path
from typing import TYPE_CHECKING, Any, Callable, TypeVar, Union
from typing import TYPE_CHECKING, Any, Callable, TypeVar
from urllib.parse import urlencode

import numpy as np
Expand Down Expand Up @@ -55,11 +55,11 @@ def wrapper_decorator(*args: tuple[Any, ...], **kwargs: dict[str, Any]) -> T:
if TYPE_CHECKING:
from collections.abc import Iterable, Sequence

import pyproj
from shapely import MultiPolygon, Polygon
from pyproj import CRS
from shapely import Polygon

DF = TypeVar("DF", pd.DataFrame, xr.Dataset)
CRSType = Union[int, str, pyproj.CRS]
CRSType = int | str | CRS
Dataset = TypeVar("Dataset", pd.DataFrame, xr.Dataset)

# Default snow params from https://doi.org/10.5194/gmd-11-1077-2018
T_RAIN = 2.5 # degC
Expand Down Expand Up @@ -174,7 +174,7 @@ def snow_func(
return clm


def separate_snow(clm: DF, t_rain: float = T_RAIN, t_snow: float = T_SNOW) -> DF:
def separate_snow(clm: Dataset, t_rain: float = T_RAIN, t_snow: float = T_SNOW) -> Dataset:
"""Separate snow based on :footcite:t:`Martinez_2010`.
Parameters
Expand Down

0 comments on commit 62a0870

Please sign in to comment.