Skip to content

Commit

Permalink
Improve time series settings documentation (#639)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrakenhoff committed Sep 18, 2023
2 parents c8e9b6f + 4cdd191 commit f52d5f8
Show file tree
Hide file tree
Showing 10 changed files with 392 additions and 102 deletions.
2 changes: 2 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@
"ml": "pastas.model.Model",
"TimestampType": "pandas.Timestamp",
}
# add custom section to docstrings in Parameters style
napoleon_custom_sections = [("Time series settings", "params_style")]

# -- Autodoc, autosummary, and autosectionlabel settings ------------------------------

Expand Down
5 changes: 3 additions & 2 deletions pastas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@

from pandas.plotting import register_matplotlib_converters

import pastas.objective_functions as objfunc
import pastas.plots as plots
import pastas.recharge as rch
import pastas.stats as stats
import pastas.timeseries_utils as ts

from .decorators import set_use_numba
from .model import Model
from .modelcompare import CompareModels
Expand All @@ -25,8 +27,7 @@
Polder,
Spline,
)
from .solver import LeastSquares, LmfitSolve, EmceeSolve
import pastas.objective_functions as objfunc
from .solver import EmceeSolve, LeastSquares, LmfitSolve
from .stressmodels import (
ChangeModel,
Constant,
Expand Down
2 changes: 1 addition & 1 deletion pastas/objective_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
`EmceeSolve` solver.
"""
from numpy import pi, log
from numpy import log, pi
from pandas import DataFrame


Expand Down
105 changes: 55 additions & 50 deletions pastas/rcparams.py
Original file line number Diff line number Diff line change
@@ -1,54 +1,59 @@
from .typing import OseriesSettingsDict, StressSettingsDict

rcParams = {
"timeseries": {
"oseries": {"fill_nan": "drop", "sample_down": "drop"},
"prec": {
"sample_up": "bfill",
"sample_down": "mean",
"fill_nan": 0.0,
"fill_before": "mean",
"fill_after": "mean",
},
"evap": {
"sample_up": "bfill",
"sample_down": "mean",
"fill_before": "mean",
"fill_after": "mean",
"fill_nan": "interpolate",
},
"well": {
"sample_up": "bfill",
"sample_down": "mean",
"fill_nan": 0.0,
"fill_before": 0.0,
"fill_after": 0.0,
},
"waterlevel": {
"sample_up": "interpolate",
"sample_down": "mean",
"fill_before": "mean",
"fill_after": "mean",
"fill_nan": "interpolate",
},
"level": {
"sample_up": "interpolate",
"sample_down": "mean",
"fill_before": "mean",
"fill_after": "mean",
"fill_nan": "interpolate",
},
"flux": {
"sample_up": "bfill",
"sample_down": "mean",
"fill_before": "mean",
"fill_after": "mean",
"fill_nan": 0.0,
},
"quantity": {
"sample_up": "divide",
"sample_down": "sum",
"fill_before": "mean",
"fill_after": "mean",
"fill_nan": 0.0,
},
"oseries": OseriesSettingsDict(
fill_nan="drop",
sample_down="drop",
),
"prec": StressSettingsDict(
sample_up="bfill",
sample_down="mean",
fill_nan=0.0,
fill_before="mean",
fill_after="mean",
),
"evap": StressSettingsDict(
sample_up="bfill",
sample_down="mean",
fill_before="mean",
fill_after="mean",
fill_nan="interpolate",
),
"well": StressSettingsDict(
sample_up="bfill",
sample_down="mean",
fill_nan=0.0,
fill_before=0.0,
fill_after=0.0,
),
"waterlevel": StressSettingsDict(
sample_up="interpolate",
sample_down="mean",
fill_before="mean",
fill_after="mean",
fill_nan="interpolate",
),
"level": StressSettingsDict(
sample_up="interpolate",
sample_down="mean",
fill_before="mean",
fill_after="mean",
fill_nan="interpolate",
),
"flux": StressSettingsDict(
sample_up="bfill",
sample_down="mean",
fill_before="mean",
fill_after="mean",
fill_nan=0.0,
),
"quantity": StressSettingsDict(
sample_up="divide",
sample_down="sum",
fill_before="mean",
fill_after="mean",
fill_nan=0.0,
),
}
}
1 change: 0 additions & 1 deletion pastas/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from scipy.linalg import svd
from scipy.optimize import least_squares


from pastas.objective_functions import GaussianLikelihood
from pastas.typing import ArrayLike, CallBack, Function, Model

Expand Down

0 comments on commit f52d5f8

Please sign in to comment.