Skip to content

Commit

Permalink
update notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
huard committed Apr 14, 2021
1 parent 05abf0b commit df9c8f6
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 150 deletions.
7 changes: 0 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@ repos:
hooks:
- id: pyupgrade
language_version: python3
- repo: https://github.com/kynan/nbstripout
rev: 0.3.9
hooks:
- id: nbstripout
language_version: python3
files: ".ipynb"
args: ["--keep-output"]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
Expand Down
92 changes: 46 additions & 46 deletions docs/notebooks/RavenPy.ipynb

Large diffs are not rendered by default.

108 changes: 33 additions & 75 deletions docs/notebooks/Running_Raven_with_CANOPEX_data.ipynb

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions docs/notebooks/climatological_ESP_forecasting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@
"</style><pre class='xr-text-repr-fallback'>&lt;xarray.DataArray ()&gt;\n",
"array(5.90491053)\n",
"Coordinates:\n",
" basin_name object &#x27;sub_001&#x27;</pre><div class='xr-wrap' hidden><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'></div></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-6e21d0ff-8b00-4aea-b388-54854cf9b2a7' class='xr-array-in' type='checkbox' checked><label for='section-6e21d0ff-8b00-4aea-b388-54854cf9b2a7' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>5.905</span></div><div class='xr-array-data'><pre>array(5.90491053)</pre></div></div></li><li class='xr-section-item'><input id='section-a1183b17-8d81-4f70-953f-afabda015882' class='xr-section-summary-in' type='checkbox' checked><label for='section-a1183b17-8d81-4f70-953f-afabda015882' class='xr-section-summary' >Coordinates: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span>basin_name</span></div><div class='xr-var-dims'>()</div><div class='xr-var-dtype'>object</div><div class='xr-var-preview xr-preview'>&#x27;sub_001&#x27;</div><input id='attrs-29bcca44-1dcf-483f-94f3-f7c4e33a71b1' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-29bcca44-1dcf-483f-94f3-f7c4e33a71b1' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-3a1383b9-c8e1-429b-8865-e4ddf6c81169' class='xr-var-data-in' type='checkbox'><label for='data-3a1383b9-c8e1-429b-8865-e4ddf6c81169' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>Name/ID of sub-basins with simulated outflows</dd><dt><span>cf_role :</span></dt><dd>timeseries_id</dd><dt><span>units :</span></dt><dd>1</dd></dl></div><div class='xr-var-data'><pre>array(&#x27;sub_001&#x27;, dtype=object)</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-cf851011-0720-44bd-8f51-0f9047732dd4' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-cf851011-0720-44bd-8f51-0f9047732dd4' class='xr-section-summary' title='Expand/collapse section'>Attributes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'></dl></div></li></ul></div></div>"
" basin_name object &#x27;sub_001&#x27;</pre><div class='xr-wrap' hidden><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'></div></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-128b820a-15aa-494f-84d6-12239ee020e1' class='xr-array-in' type='checkbox' checked><label for='section-128b820a-15aa-494f-84d6-12239ee020e1' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>5.905</span></div><div class='xr-array-data'><pre>array(5.90491053)</pre></div></div></li><li class='xr-section-item'><input id='section-668c6e6f-007e-4f87-b568-a444fa36f513' class='xr-section-summary-in' type='checkbox' checked><label for='section-668c6e6f-007e-4f87-b568-a444fa36f513' class='xr-section-summary' >Coordinates: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span>basin_name</span></div><div class='xr-var-dims'>()</div><div class='xr-var-dtype'>object</div><div class='xr-var-preview xr-preview'>&#x27;sub_001&#x27;</div><input id='attrs-3276412c-fb52-4809-9f4b-1a2f0629e01d' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-3276412c-fb52-4809-9f4b-1a2f0629e01d' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-8358f664-ddf2-46a7-8094-e1f358f0b59a' class='xr-var-data-in' type='checkbox'><label for='data-8358f664-ddf2-46a7-8094-e1f358f0b59a' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>Name/ID of sub-basins with simulated outflows</dd><dt><span>cf_role :</span></dt><dd>timeseries_id</dd><dt><span>units :</span></dt><dd>1</dd></dl></div><div class='xr-var-data'><pre>array(&#x27;sub_001&#x27;, dtype=object)</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-4a15cf15-7345-40ea-9f84-f76551555747' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-4a15cf15-7345-40ea-9f84-f76551555747' class='xr-section-summary' title='Expand/collapse section'>Attributes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'></dl></div></li></ul></div></div>"
],
"text/plain": [
"<xarray.DataArray ()>\n",
Expand Down Expand Up @@ -567,9 +567,9 @@
"name": "stdout",
"output_type": "stream",
"text": [
"2021-04-09 10:30:41,895 - root - INFO - initialized | lead: 01 | inits: 1957-06-30 00:00:00-1958-06-30 00:00:00 | verifs: 1957-07-01 00:00:00-1958-07-01 00:00:00\n",
"2021-04-09 10:30:41,901 - root - INFO - initialized | lead: 02 | inits: 1957-06-30 00:00:00-1958-06-30 00:00:00 | verifs: 1957-07-02 00:00:00-1958-07-02 00:00:00\n",
"2021-04-09 10:30:41,912 - root - INFO - initialized | lead: 03 | inits: 1957-06-30 00:00:00-1958-06-30 00:00:00 | verifs: 1957-07-03 00:00:00-1958-07-03 00:00:00\n"
"2021-04-14 16:42:35,176 - root - INFO - initialized | lead: 01 | inits: 1957-06-30 00:00:00-1958-06-30 00:00:00 | verifs: 1957-07-01 00:00:00-1958-07-01 00:00:00\n",
"2021-04-14 16:42:35,189 - root - INFO - initialized | lead: 02 | inits: 1957-06-30 00:00:00-1958-06-30 00:00:00 | verifs: 1957-07-02 00:00:00-1958-07-02 00:00:00\n",
"2021-04-14 16:42:35,199 - root - INFO - initialized | lead: 03 | inits: 1957-06-30 00:00:00-1958-06-30 00:00:00 | verifs: 1957-07-03 00:00:00-1958-07-03 00:00:00\n"
]
}
],
Expand All @@ -590,7 +590,7 @@
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0x7f76dfbec820>]"
"[<matplotlib.lines.Line2D at 0x7ff7fcc935b0>]"
]
},
"execution_count": 7,
Expand Down
26 changes: 13 additions & 13 deletions docs/notebooks/hydro_routing_product_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -33,7 +33,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -135,7 +135,7 @@
"<AxesSubplot:>"
]
},
"execution_count": null,
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
},
Expand Down Expand Up @@ -177,7 +177,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -1166,7 +1166,7 @@
"[33 rows x 24 columns]"
]
},
"execution_count": null,
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -1179,7 +1179,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -1222,7 +1222,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -1235,7 +1235,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -1253,7 +1253,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand All @@ -1270,7 +1270,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -1289,16 +1289,16 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0x7fe80c219520>]"
"[<matplotlib.lines.Line2D at 0x7fda1d3e9e50>]"
]
},
"execution_count": null,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
},
Expand Down
5 changes: 1 addition & 4 deletions ravenpy/utilities/nb_graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,14 @@
import xarray as xr
from matplotlib import pyplot as plt

from . import docs_import_error_message

try:
import holoviews as hv
import hvplot.xarray

# from holoviews.streams import Buffer
# from bokeh.models import Range1d, LinearAxis
except (ImportError, ModuleNotFoundError) as e:
msg = docs_import_error_message.format(Path(__file__).stem)
raise ImportError(msg) from e
raise ImportError("Install holoviews and hvplot.") from e

hv.extension("bokeh")

Expand Down

0 comments on commit df9c8f6

Please sign in to comment.