-
Notifications
You must be signed in to change notification settings - Fork 70
/
typeh.py
43 lines (40 loc) · 1.66 KB
/
typeh.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Type hinting for Pastas library
# Base Classes for TypeVar
# Internal
import pastas as ps
# from pastas.noisemodels import NoiseModelBase
# from pastas.stressmodels import StressModelBase
# from pastas.solver import BaseSolver
# from pastas.timeseries import TimeSeries
# from pastas.model import Model
# from pastas.plots import TrackSolve
# from pastas.timer import SolveTimer
# from pastas.rfunc import RfuncBase
# from pastas.reservoir import ReservoirBase
# from pastas.recharge import RechargeBase
# External libraries
# Pandas
from pandas import Timestamp # Series, DataFrame
# Matplotlib
from matplotlib.axes._base import _AxesBase
from matplotlib.figure import FigureBase
# Numpy
from numpy.typing import ArrayLike
# Typing
from typing import Type, Union, Optional, Tuple, List, Any, TypeVar
pstAx = TypeVar("pstAx", bound=_AxesBase) # Matplotlib Axes
pstFi = TypeVar("pstFi", bound=FigureBase) # Matplotlib Figure
# pstS = TypeVar("pstS", bound=Type[Series])
# pstDF = TypeVar("pstDF", bound=Type[DataFrame])
pstTm = TypeVar("pstTm", bound=Union[str, Timestamp]) # Tmin or Tmax
pstMl = TypeVar("pstMl", bound=Any) # Model
pstTS = TypeVar("pstTS", bound=Any) # Time Series
pstSM = TypeVar("pstSM", bound=Any) # Stress Model
pstNM = TypeVar("pstNM", bound=Any) # Noise Model
pstBS = TypeVar("pstBS", bound=Any) # Base Solver
pstRB = TypeVar("pstRB", bound=Any) # Recharge Base
pstRV = TypeVar("pstRV", bound=Any) # Reservoir Base
pstCB = TypeVar("pstCB", bound=Any) # Callback
pstFu = TypeVar("pstFu", bound=Any) # Function (e.g. Objective Function)
pstRF = TypeVar("pstRF", bound=Any) # rFunc Base
pstAL = TypeVar("pstAL", bound=Type[ArrayLike]) # Array Like (NumPy based)