Skip to content

Commit

Permalink
Merge pull request #179 from Ouranosinc/fix-125
Browse files Browse the repository at this point in the history
Fix 125
  • Loading branch information
huard authored Dec 10, 2019
2 parents 378b58a + 755cccc commit 78cd7c5
Show file tree
Hide file tree
Showing 31 changed files with 213 additions and 89 deletions.
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changes
=======


0.9.x (2019-11-11)
------------------
* Return configuration files used to run model in a zip archive


0.8.x (2019-10-22)
------------------
* Added more documentation for users
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# vim:set ft=dockerfile:
FROM continuumio/miniconda3
MAINTAINER https://github.com/huard/raven
LABEL Description="Raven WPS" Vendor="Birdhouse" Version="0.8.3-beta"
LABEL Description="Raven WPS" Vendor="Birdhouse" Version="0.9.0-beta"

# Update Debian system
RUN apt-get update && apt-get install -y \
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
# The short X.Y version.
version = ''
# The full version, including alpha/beta/rc tags.
release = '0.8.3-beta'
release = '0.9.0-beta'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
30 changes: 27 additions & 3 deletions docs/source/notebooks/Raven_run_parallel_basins.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"metadata": {
"scrolled": true
},
Expand Down Expand Up @@ -66,8 +66,7 @@
"# With `asobj` set to False, only the reference to the output is returned in the response. \n",
"# Setting `asobj` to True will retrieve the actual files and copy the locally.\n",
"\n",
"### asobj= True is failing!\n",
"[hydrograph, storage, solution, diagnostics] = resp.get(asobj=True)"
"[hydrograph, storage, solution, diagnostics, rv] = resp.get(asobj=True)"
]
},
{
Expand Down Expand Up @@ -131,6 +130,31 @@
"hydrograph.q_sim.isel(nbasins=0).plot.line(hue='realization')\n",
"hydrograph.q_sim.isel(nbasins=1).plot.line(hue='realization')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The individual configuration files for each model run can be accessed as a Zip archive. "
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"RV configuration http://localhost:9099/outputs/1cc2537a-04c2-11ea-9fc6-b052162515fb/rv.zip\n"
]
}
],
"source": [
"[hydrograph, storage, solution, diagnostics, rv] = resp.get(asobj=False)\n",
"print (\"RV configuration\", rv)"
]
}
],
"metadata": {
Expand Down
15 changes: 4 additions & 11 deletions docs/source/notebooks/Region_selection.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "6bf0347c6e9846b48bd0f5c7b54816ce",
"model_id": "924131a218144745b3153d054c14c178",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -139,7 +139,7 @@
{
"data": {
"text/plain": [
"[-72.33398437500001, 48.748945343432936]"
"[-74.71, 48.63]"
]
},
"execution_count": 7,
Expand All @@ -160,7 +160,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "a484d2457236427e97fcefe4439800a6",
"model_id": "bdf29bd851064fa2bebf25fb871d2e94",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -185,7 +185,7 @@
"outputs": [],
"source": [
"# NBVAL_SKIP\n",
"# Before continuing, wait for the process to finish!\n",
"# Before continuing, wait for the process above to finish.\n",
"\n",
"# Extract the URL of the resulting GeoJSON feature\n",
"features, ids = resp.get(asobj=True)\n",
Expand Down Expand Up @@ -222,13 +222,6 @@
"\n",
"user_geojson.on_hover(update_html)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
12 changes: 6 additions & 6 deletions docs/source/notebooks/Run_Raven_with_Parallel_parameters.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@
" * time (time) datetime64[ns] 2000-01-01 2000-01-02 ... 2002-01-01\n",
"Dimensions without coordinates: nbasins, params\n",
"Data variables:\n",
" q_obs (time, nbasins) float64 ...\n",
" precip (time) float64 ...\n",
" q_in (time, nbasins) float64 ...\n",
" q_obs (time, nbasins) float64 ...\n",
" q_sim (params, time, nbasins) float64 ...\n",
"Attributes:\n",
" Conventions: CF-1.6\n",
" featureType: timeSeries\n",
" history: Created on 2019-10-29 11:22:33 by Raven\n",
" history: Created on 2019-12-09 21:38:45 by Raven\n",
" description: Standard Output\n",
" title: Simulated river discharge\n",
" references: Craig J.R. and the Raven Development Team Raven use...\n",
Expand All @@ -107,7 +107,7 @@
}
],
"source": [
"[hydrograph, storage, solution, diagnostics] = resp.get(asobj=True)\n",
"[hydrograph, storage, solution, diagnostics, rv] = resp.get(asobj=True)\n",
"hydrograph"
]
},
Expand All @@ -119,8 +119,8 @@
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0x7fe08d97fe10>,\n",
" <matplotlib.lines.Line2D at 0x7fe08c1c25c0>]"
"[<matplotlib.lines.Line2D at 0x7f293ab47be0>,\n",
" <matplotlib.lines.Line2D at 0x7f29393ae518>]"
]
},
"execution_count": 4,
Expand Down Expand Up @@ -157,7 +157,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"['observed data series,filename,DIAG_NASH_SUTCLIFFE,DIAG_RMSE,\\nHYDROGRAPH,/tmp/pywps_process_sjtmeoxe/input.nc,-0.0371048,36.562,\\n', 'observed data series,filename,DIAG_NASH_SUTCLIFFE,DIAG_RMSE,\\nHYDROGRAPH,/tmp/pywps_process_sjtmeoxe/input.nc,0.0198906,35.5431,\\n']\n"
"['observed data series,filename,DIAG_NASH_SUTCLIFFE,DIAG_RMSE,\\nHYDROGRAPH,/tmp/pywps_process_iwzw_c5a/Salmon-River-Near-Prince-George_meteo_daily.nc,-0.0371048,36.562,\\n', 'observed data series,filename,DIAG_NASH_SUTCLIFFE,DIAG_RMSE,\\nHYDROGRAPH,/tmp/pywps_process_iwzw_c5a/Salmon-River-Near-Prince-George_meteo_daily.nc,0.0198906,35.5431,\\n']\n"
]
}
],
Expand Down
4 changes: 2 additions & 2 deletions docs/source/notebooks/computing_objective_functions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"# With `asobj` set to False, only the reference to the output is returned in the response. \n",
"# Setting `asobj` to True will retrieve the actual files and copy the locally.\n",
"# Here we use false, as we do not want the file, we only want the path to the file.\n",
"[hydrograph, storage, solution, diagnostics] = resp.get(asobj=False)"
"[hydrograph, storage, solution, diagnostics, rv] = resp.get(asobj=False)"
]
},
{
Expand Down Expand Up @@ -154,7 +154,7 @@
"source": [
"# Rerun the model but this time get the object (asobj=True)\n",
"resp2 = wps.raven_gr4j_cemaneige(ts=str(ts), params = params, **config)\n",
"[hydrograph, storage, solution, diagnostics] = resp2.get(asobj=False)\n"
"[hydrograph, storage, solution, diagnostics, rv] = resp2.get(asobj=False)\n"
]
},
{
Expand Down
12 changes: 6 additions & 6 deletions docs/source/notebooks/getting_variables_other_than_flow.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"# And get the response\n",
"# With `asobj` set to False, only the reference to the output is returned in the response. \n",
"# Setting `asobj` to True will retrieve the actual files and copy the locally. \n",
"[hydrograph, storage, solution, diagnostics] = resp.get(asobj=True)"
"[hydrograph, storage, solution, diagnostics, rv] = resp.get(asobj=True)"
]
},
{
Expand All @@ -76,7 +76,7 @@
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0x7f60b6dc8ba8>]"
"[<matplotlib.lines.Line2D at 0x7f863deb7da0>]"
]
},
"execution_count": 3,
Expand Down Expand Up @@ -118,7 +118,7 @@
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0x7f60b55b37f0>]"
"[<matplotlib.lines.Line2D at 0x7f863ca46208>]"
]
},
"execution_count": 4,
Expand Down Expand Up @@ -187,7 +187,7 @@
"Attributes:\n",
" Conventions: CF-1.6\n",
" featureType: timeSeries\n",
" history: Created on 2019-10-29 09:42:54 by Raven\n",
" history: Created on 2019-12-09 21:38:14 by Raven\n",
" description: Standard Output\n",
" title: Simulated river discharge\n",
" references: Craig J.R. and the Raven Development Team Raven use...\n",
Expand Down Expand Up @@ -219,12 +219,12 @@
"name": "stdout",
"output_type": "stream",
"text": [
"https://pavics.ouranos.ca/wpsoutputs/908b081a-0599-11ea-ac64-0242ac120009/raven-gr4j-cemaneige-sim-0_WatershedStorage.nc\n"
"http://localhost:9099/outputs/1d4bd04c-1af6-11ea-8db8-b052162515fb/raven-gr4j-cemaneige-sim-0_WatershedStorage.nc\n"
]
}
],
"source": [
"[hydrograph, storage, solution, diagnostics] = resp.get(asobj=False)\n",
"[hydrograph, storage, solution, diagnostics, rv] = resp.get(asobj=False)\n",
"print(storage)"
]
}
Expand Down
10 changes: 5 additions & 5 deletions docs/source/notebooks/multi_model_simulation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"['observed data series,filename,DIAG_NASH_SUTCLIFFE,DIAG_RMSE,\\nHYDROGRAPH,/tmp/pywps_process_wkg0pr3n/input.nc,-0.0371048,36.562,\\n', 'observed data series,filename,DIAG_NASH_SUTCLIFFE,DIAG_RMSE,\\nHYDROGRAPH,/tmp/pywps_process_wkg0pr3n/input.nc,-7.03141,101.745,\\n']\n",
"['observed data series,filename,DIAG_NASH_SUTCLIFFE,DIAG_RMSE,\\nHYDROGRAPH,/tmp/pywps_process_6t3oy58_/Salmon-River-Near-Prince-George_meteo_daily.nc,-0.0371048,36.562,\\n', 'observed data series,filename,DIAG_NASH_SUTCLIFFE,DIAG_RMSE,\\nHYDROGRAPH,/tmp/pywps_process_6t3oy58_/Salmon-River-Near-Prince-George_meteo_daily.nc,-7.03141,101.745,\\n']\n",
"[<xarray.Dataset>\n",
"Dimensions: (nbasins: 1, time: 732)\n",
"Coordinates:\n",
Expand All @@ -91,7 +91,7 @@
"Attributes:\n",
" Conventions: CF-1.6\n",
" featureType: timeSeries\n",
" history: Created on 2019-10-29 16:40:01 by Raven\n",
" history: Created on 2019-12-09 21:37:04 by Raven\n",
" description: Standard Output\n",
" title: Simulated river discharge\n",
" references: Craig J.R. and the Raven Development Team Raven use...\n",
Expand All @@ -113,7 +113,7 @@
"Attributes:\n",
" Conventions: CF-1.6\n",
" featureType: timeSeries\n",
" history: Created on 2019-10-29 16:40:01 by Raven\n",
" history: Created on 2019-12-09 21:37:04 by Raven\n",
" description: Standard Output\n",
" title: Simulated river discharge\n",
" references: Craig J.R. and the Raven Development Team Raven use...\n",
Expand All @@ -129,7 +129,7 @@
"# And get the response\n",
"# With `asobj` set to False, only the reference to the output is returned in the response. \n",
"# Setting `asobj` to True will retrieve the actual files and copy the locally. \n",
"[hydrograph, storage, solution, diagnostics] = resp.get(asobj=True)\n",
"[hydrograph, storage, solution, diagnostics, rv] = resp.get(asobj=True)\n",
"print(diagnostics)\n",
"print(hydrograph)"
]
Expand Down Expand Up @@ -183,7 +183,7 @@
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0x7f0bcacdd7b8>]"
"[<matplotlib.lines.Line2D at 0x7f4db11bba58>]"
]
},
"execution_count": 5,
Expand Down
10 changes: 5 additions & 5 deletions docs/source/notebooks/running_OSTRICH_gr4jcn.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"# And get the response\n",
"# With `asobj` set to False, only the reference to the output is returned in the response. \n",
"# Setting `asobj` to True will retrieve the actual files and copy the locally. \n",
"[calibration, hydrograph, storage, solution, diagnostics, calibparams] = resp.get(asobj=True)"
"[calibration, hydrograph, storage, solution, diagnostics, calibparams, rv] = resp.get(asobj=True)"
]
},
{
Expand Down Expand Up @@ -141,7 +141,7 @@
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0x7fa9715ffd68>]"
"[<matplotlib.lines.Line2D at 0x7fbd4ee99c88>]"
]
},
"execution_count": 5,
Expand Down Expand Up @@ -219,7 +219,7 @@
{
"data": {
"text/plain": [
"'observed data series,filename,DIAG_NASH_SUTCLIFFE,DIAG_RMSE,\\nHYDROGRAPH,/tmp/pywps_process_8va3eh76/input.nc,0.486033,37.1449,\\n'"
"'observed data series,filename,DIAG_NASH_SUTCLIFFE,DIAG_RMSE,\\nHYDROGRAPH,/tmp/pywps_process_pz1s4vs8/Salmon-River-Near-Prince-George_meteo_daily.nc,0.486033,37.1449,\\n'"
]
},
"execution_count": 7,
Expand Down Expand Up @@ -254,7 +254,7 @@
" )\n",
"# Let's call the model with the timeseries, model parameters and other configuration parameters\n",
"resp = wps.raven_gr4j_cemaneige(ts=str(ts), params=calibparams, **config)\n",
"[hydrograph, storage, solution, diagnostics2] = resp.get(asobj=True)"
"[hydrograph, storage, solution, diagnostics2, rv2] = resp.get(asobj=True)"
]
},
{
Expand All @@ -272,7 +272,7 @@
{
"data": {
"text/plain": [
"'observed data series,filename,DIAG_NASH_SUTCLIFFE,DIAG_RMSE,\\nHYDROGRAPH,/tmp/pywps_process_y12_bm6h/input.nc,0.486033,37.1449,\\n'"
"'observed data series,filename,DIAG_NASH_SUTCLIFFE,DIAG_RMSE,\\nHYDROGRAPH,/tmp/pywps_process_g0iwrw_v/Salmon-River-Near-Prince-George_meteo_daily.nc,0.486033,37.1449,\\n'"
]
},
"execution_count": 9,
Expand Down
Loading

0 comments on commit 78cd7c5

Please sign in to comment.