Skip to content

Commit

Permalink
Merge pull request #323 from bird-house/tests
Browse files Browse the repository at this point in the history
Done for now. 
Next step will be:
Testdata for ensemble processes #328
  • Loading branch information
nilshempelmann authored May 5, 2020
2 parents 1f135c0 + bb38303 commit 19736e0
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 447 deletions.
2 changes: 1 addition & 1 deletion docs/source/notebooks/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ These examples demonstrates a few features of the Flyingpigeon server.
.. toctree::

subset_processes
plot_indices
../plot_indices
426 changes: 0 additions & 426 deletions docs/source/notebooks/plot_indices.ipynb

This file was deleted.

49 changes: 29 additions & 20 deletions docs/source/notebooks/subset_processes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@
"from IPython.core.display import HTML \n",
"from IPython.display import Image\n",
"\n",
"# Download files stored in a metalink\n",
"from metalink import download\n",
"import tempfile\n",
"\n",
"# wait until WPS process is finished\n",
"import time"
]
Expand All @@ -48,15 +44,15 @@
"name": "stdout",
"output_type": "stream",
"text": [
"http://localhost:8093/wps\n"
"http://localhost:8093\n"
]
}
],
"source": [
"# This cell is for server admnistration test purpose\n",
"# Ignore this cell and modify the following cell according to your needs\n",
"\n",
"fp_server = environ.get('FYINGPIGEON_WPS_URL')\n",
"fp_server = environ.get('WPS_URL')\n",
"print(fp_server) # link to the flyingpigoen server"
]
},
Expand Down Expand Up @@ -139,10 +135,16 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"# some test data \n",
"\n",
"# 'https://github.com/roocs/mini-esgf-data/raw/master/test_data/group_workspaces/jasmin2/cp4cds1/data/c3s-cordex/output/EUR-11/IPSL/MOHC-HadGEM2-ES/rcp85/r1i1p1/IPSL-WRF381P/v1/day/psl/v20190212/'\n",
"# 'psl_EUR-11_MOHC-HadGEM2-ES_rcp85_r1i1p1_IPSL-WRF381P_v1_day_20060101-20101231.nc'\n",
"\n",
"\n",
"# Specify input files\n",
"base_url = 'https://www.esrl.noaa.gov/psd/thredds/fileServer/Datasets/ncep.reanalysis.dailyavgs/surface/'\n",
"urls = [base_url + f'slp.{year}.nc' for year in range(2000, 2002)]"
Expand Down Expand Up @@ -188,7 +190,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "ee34fdc2c29b4d98a716063f03dd6ec0",
"model_id": "05cdf86b83cb49ea9d52d4f528728ff9",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -235,7 +237,7 @@
{
"data": {
"text/html": [
"<img src=\"http://127.0.0.1:8093/outputs/e5325448-7382-11ea-af28-9cb6d08a53e7/tmpidmph83w.png\" width=\"400\"/>"
"<img src=\"http://localhost:8093/outputs/e83583a4-88a4-11ea-bb59-9cb6d08a53e7/tmp57htomkn.png\" width=\"400\"/>"
],
"text/plain": [
"<IPython.core.display.Image object>"
Expand All @@ -256,16 +258,16 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 12,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Metalink content-type detected.\n",
"Downloading to /tmp/tmp3024zigh/slp.2000_bbox_subset.nc.\n",
"Downloading to /tmp/tmp3024zigh/slp.2001_bbox_subset.nc.\n"
"Downloading to /tmp/tmp_v07l0_1/slp.2000_bbox_subset.nc.\n",
"Downloading to /tmp/tmp_v07l0_1/slp.2001_bbox_subset.nc.\n"
]
},
{
Expand All @@ -274,14 +276,21 @@
"2"
]
},
"execution_count": 10,
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# If you want to download the result files: \n",
"\n",
"# Download files stored in a metalink\n",
"# requires https://github.com/metalink-dev/pymetalink\n",
"#\n",
"from metalink import download\n",
"import tempfile\n",
"\n",
"\n",
"path = tempfile.mkdtemp()\n",
"files = download.get(bbox.metalink, path=path, segmented=False, force=True)\n",
"len(files)"
Expand All @@ -304,13 +313,13 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "4081afd2aae44ddba83bfcefbbbfd73b",
"model_id": "71dfb09df2954890b8e375d7254a163d",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -341,7 +350,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 14,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -351,7 +360,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 15,
"metadata": {},
"outputs": [
{
Expand All @@ -361,7 +370,7 @@
"<IPython.core.display.Image object>"
]
},
"execution_count": 13,
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -381,7 +390,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -409,7 +418,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 17,
"metadata": {},
"outputs": [],
"source": [
Expand Down

0 comments on commit 19736e0

Please sign in to comment.