Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds a download agent to pooch/Deveraux calls #231

Merged
merged 6 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ Contributors to this version: Thomas-Charles Fortier Filion (:user:`TC-FF`).

Internal changes
^^^^^^^^^^^^^^^^
land_use_classification default collection has been changed to io-lulc-annual-v02 as previous one will be deprecated december 2024. (:pull:`227`).
Also added some collection, year, resolution and history attributes to xarray output of land_use_classification. (:pull:`227`).
* land_use_classification default collection has been changed to io-lulc-annual-v02 as previous one will be deprecated december 2024. (:pull:`227`).
* Also added some collection, year, resolution and history attributes to xarray output of land_use_classification. (:pull:`227`).
* Added a downloader agent to fix an issue related to ``pooch`` in recent ReadTheDocs builds. (:pull:`231`).

v0.4.1 (2024-11-07)
-------------------
Expand Down
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
126 changes: 27 additions & 99 deletions docs/notebooks/pmp.ipynb

Large diffs are not rendered by default.

Loading