From 6a567a5d66b9cad2d66dafbb0fa17254c20f4b86 Mon Sep 17 00:00:00 2001 From: Zeitsperre <10819524+Zeitsperre@users.noreply.github.com> Date: Fri, 25 Aug 2023 12:54:25 -0400 Subject: [PATCH 1/5] add platformdirs, set default testing data cache to standard location --- pyproject.toml | 1 + xclim/testing/utils.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index fe4aa4544..9ad85a86f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -68,6 +68,7 @@ dev = [ "nbqa", "nbval", "netCDF4 >=1.4", + "platformdirs >=3.2", "pre-commit >=2.9", "pydocstyle >=5.1.1", "pybtex", diff --git a/xclim/testing/utils.py b/xclim/testing/utils.py index 44978e563..e53ff087e 100644 --- a/xclim/testing/utils.py +++ b/xclim/testing/utils.py @@ -23,6 +23,7 @@ from urllib.request import urlopen, urlretrieve import pandas as pd +from platformdirs import user_cache_dir from xarray import Dataset from xarray import open_dataset as _open_dataset @@ -48,7 +49,7 @@ ] -_default_cache_dir = Path.home() / ".xclim_testing_data" +_default_cache_dir = Path(user_cache_dir("xclim-testdata")) logger = logging.getLogger("xclim") From b23e7495af84ffa3ae8d0f6d6579f0317f3e1269 Mon Sep 17 00:00:00 2001 From: Zeitsperre <10819524+Zeitsperre@users.noreply.github.com> Date: Fri, 25 Aug 2023 12:59:15 -0400 Subject: [PATCH 2/5] update CHANGES.rst --- CHANGES.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index ef6e5b1d9..71b4ffec9 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -6,6 +6,10 @@ v0.45.0 (unreleased) -------------------- Contributors to this version: David Huard (:user:`huard`), Trevor James Smith (:user:`Zeitsperre`), Pascal Bourgault (:user:`aulemahal`), Juliette Lavoie (:user:`juliettelavoie`), Gabriel Rondeau-Genesse (:user:`RondeauG`), Marco Braun (:user:`vindelico`), Éric Dupuis (:user:`coxipi`). +Announcements +^^^^^^^^^^^^^ +* `xclim` now uses `platformdirs` to write `xclim-testdata` to the user's cache directory. Dynamic paths are now used to cache data dependent on the user's operating system. Developers can now safely delete the `.xclim-testdata` folder in their home directory without affecting the functionality of `xclim`. + New features and enhancements ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ * Added ``ensembles.hawkins_sutton`` method to partition the uncertainty sources in a climate projection ensemble. (:issue:`771`, :pull:`1262`). From 82c08c7ca99ccf3bddeffeaba9679a65df13a70b Mon Sep 17 00:00:00 2001 From: Zeitsperre <10819524+Zeitsperre@users.noreply.github.com> Date: Fri, 25 Aug 2023 13:00:12 -0400 Subject: [PATCH 3/5] add platformdirs to environment.yml --- environment.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/environment.yml b/environment.yml index 0faeff617..34defe4a7 100644 --- a/environment.yml +++ b/environment.yml @@ -47,6 +47,7 @@ dependencies: - nc-time-axis - netCDF4>=1.4 - notebook + - platformdirs - pooch - pre-commit - pybtex From 9fdccf986ba0719effd567e32f20430118e3d400 Mon Sep 17 00:00:00 2001 From: Zeitsperre <10819524+Zeitsperre@users.noreply.github.com> Date: Fri, 25 Aug 2023 13:08:25 -0400 Subject: [PATCH 4/5] add PR number --- CHANGES.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 71b4ffec9..b12568c99 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -8,7 +8,7 @@ Contributors to this version: David Huard (:user:`huard`), Trevor James Smith (: Announcements ^^^^^^^^^^^^^ -* `xclim` now uses `platformdirs` to write `xclim-testdata` to the user's cache directory. Dynamic paths are now used to cache data dependent on the user's operating system. Developers can now safely delete the `.xclim-testdata` folder in their home directory without affecting the functionality of `xclim`. +* `xclim` now uses `platformdirs` to write `xclim-testdata` to the user's cache directory. Dynamic paths are now used to cache data dependent on the user's operating system. Developers can now safely delete the `.xclim-testdata` folder in their home directory without affecting the functionality of `xclim`. (:pull:`1460`). New features and enhancements ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ From 0eb9ff126deabf5351a69b6d8903b9a613fb7e63 Mon Sep 17 00:00:00 2001 From: "bumpversion[bot]" Date: Mon, 28 Aug 2023 19:51:00 +0000 Subject: [PATCH 5/5] =?UTF-8?q?Bump=20version:=200.44.19-beta=20=E2=86=92?= =?UTF-8?q?=200.44.20-beta?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup.cfg | 2 +- xclim/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 2e13a047c..d3ec73a37 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.44.19-beta +current_version = 0.44.20-beta commit = True tag = False parse = (?P\d+)\.(?P\d+).(?P\d+)(\-(?P[a-z]+))? diff --git a/xclim/__init__.py b/xclim/__init__.py index 1d0922739..eb123fc9f 100644 --- a/xclim/__init__.py +++ b/xclim/__init__.py @@ -11,7 +11,7 @@ __author__ = """Travis Logan""" __email__ = "logan.travis@ouranos.ca" -__version__ = "0.44.19-beta" +__version__ = "0.44.20-beta" # Load official locales