Skip to content

Commit

Permalink
add agent to pooch
Browse files Browse the repository at this point in the history
  • Loading branch information
RondeauG committed Nov 20, 2024
1 parent 5914012 commit 203ded1
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 105 deletions.
11 changes: 7 additions & 4 deletions docs/notebooks/climate_change.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,20 @@
"from xhydro.testing.helpers import deveraux\n",
"\n",
"D = deveraux()\n",
"downloader = pooch.HTTPDownloader(headers={\"User-Agent\": f\"xHydro-{xh.__version__}\"})\n",
"\n",
"# Future streamflow file (1 file - Hydrotel driven by BCC-CSM-1.1(m))\n",
"streamflow_file = D.fetch(\n",
" \"cc_indicators/streamflow_BCC-CSM1.1-m_rcp45.nc\",\n",
" \"cc_indicators/streamflow_BCC-CSM1.1-m_rcp45.nc\", downloader=downloader\n",
")\n",
"\n",
"# Reference mean annual streamflow (QMOYAN) for 6 calibrations of Hydrotel\n",
"reference_files = D.fetch(\"cc_indicators/reference.zip\", pooch.Unzip())\n",
"reference_files = D.fetch(\n",
" \"cc_indicators/reference.zip\", pooch.Unzip(), downloader=downloader\n",
")\n",
"\n",
"# Future deltas of QMOYAN (63 simulations x 6 calibrations of Hydrotel)\n",
"deltas_files = D.fetch(\"cc_indicators/deltas.zip\", pooch.Unzip())"
"deltas_files = D.fetch(\"cc_indicators/deltas.zip\", pooch.Unzip(), downloader=downloader)"
]
},
{
Expand Down Expand Up @@ -651,7 +654,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.3"
"version": "3.12.7"
}
},
"nbformat": 4,
Expand Down
5 changes: 3 additions & 2 deletions docs/notebooks/hydrological_modelling.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,12 @@
"from xhydro.testing.helpers import deveraux\n",
"\n",
"D = deveraux()\n",
"downloader = pooch.HTTPDownloader(headers={\"User-Agent\": f\"xHydro-{xh.__version__}\"})\n",
"\n",
"# This notebook will use ERA5 data for a small watershed in Eastern Quebec, along with faked elevation data.\n",
"\n",
"# Streamflow file (1 file - Hydrotel driven by BCC-CSM-1.1(m))\n",
"meteo_file = D.fetch(\"hydro_modelling/ERA5_testdata.nc\")\n",
"meteo_file = D.fetch(\"hydro_modelling/ERA5_testdata.nc\", downloader=downloader)\n",
"ds = xr.open_dataset(meteo_file)\n",
"ds"
]
Expand Down Expand Up @@ -509,7 +510,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.3"
"version": "3.12.7"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 203ded1

Please sign in to comment.