Skip to content

Commit

Permalink
fix notebooks pd Timestamp errors
Browse files Browse the repository at this point in the history
  • Loading branch information
martinvonk committed Feb 17, 2023
1 parent 4cc49df commit 51f8282
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions doc/examples/03_calibration_options.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
"axes = ml.plots.results(\n",
" tmin=\"1975\", figsize=(10, 6)\n",
") # Use tmin=1975 to show warmup period\n",
"axes[0].axvline(\"1986\", c=\"k\", linestyle=\"--\"); # Start of calibration"
"axes[0].axvline(pd.Timestamp(\"1986\"), c=\"k\", linestyle=\"--\"); # Start of calibration"
]
},
{
Expand Down Expand Up @@ -271,7 +271,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.15 | packaged by conda-forge | (main, Nov 22 2022, 08:41:22) [MSC v.1929 64 bit (AMD64)]"
"version": "3.9.15"
},
"vscode": {
"interpreter": {
Expand Down
8 changes: 4 additions & 4 deletions doc/examples/08_changing_responses.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"axes = ps.plots.series(\n",
" head=head,\n",
" stresses=[prec, evap, river],\n",
" tmin=\"2000\",\n",
" tmin=pd.Timestamp(\"2000\"),\n",
" labels=[\"Head\\n[m]\", \"Prec\\n[mm/d]\", \"Evap\\n[mm/d]\", \"River [m3/d]\"],\n",
")"
]
Expand Down Expand Up @@ -278,7 +278,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "artesia",
"display_name": "pastas_dev",
"language": "python",
"name": "python3"
},
Expand All @@ -292,11 +292,11 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
"version": "3.9.15"
},
"vscode": {
"interpreter": {
"hash": "dace5e1b41a98a8e52d2a8eebc3b981caf2c12e7a76736ebfb89a489e3b62e79"
"hash": "29475f8be425919747d373d827cb41e481e140756dd3c75aa328bf3399a0138e"
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions doc/examples/15_timestep_analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@
" ml.simulate(tmax=\"2020\").plot(ax=ax, alpha=0.5, c=color, x_compat=True)\n",
" ax.set_xticks([])\n",
" ax.set_ylabel(\"GWL [m]\")\n",
" ax.set_xlim(\"2007\", \"2020\")\n",
" ax.set_xlim(pd.Timestamp(\"2007\"), pd.Timestamp(\"2020\"))\n",
"\n",
"df1.groupby(level=0, axis=1).mean().plot.bar(\n",
" yerr=1.96 * df1.groupby(level=0, axis=1).std(numeric_only=True), ax=ax3, width=0.7\n",
Expand Down Expand Up @@ -442,7 +442,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.5"
"version": "3.9.15"
},
"vscode": {
"interpreter": {
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/18_sgi_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@
"ax2.set_title(\"SGI With Groundwater pumping\")\n",
"ax3.set_ylabel(\"SGI [-]\")\n",
"ax3.set_title(\"SGI under 'Natural conditions'\")\n",
"plt.xlim(\"1940\", \"2016\");"
"plt.xlim(pd.Timestamp(\"1940\"), pd.Timestamp(\"2016\"));"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion pastas/modelplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ def custom_sort(t):

# add stacked plot to correct axes
ax = axes[i - 1]
del ax.lines[0] # delete existing line
ax.lines[0].remove() # delete existing line

contrib = [c[1] for c in contributions] # get time series
vstack = concat(contrib, axis=1, sort=False)
Expand Down

0 comments on commit 51f8282

Please sign in to comment.