Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve time series settings documentation #639

Merged
merged 10 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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