diff --git a/CHANGES.rst b/CHANGES.rst index 75d358d5a..c43c04013 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`. (:pull:`1460`). + New features and enhancements ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ * Added ``ensembles.hawkins_sutton`` method to partition the uncertainty sources in a climate projection ensemble. (:issue:`771`, :pull:`1262`). 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 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/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 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")