From 8592a37dafcad634ef751a610a7e2085aaf7e49e Mon Sep 17 00:00:00 2001 From: Zeitsperre <10819524+Zeitsperre@users.noreply.github.com> Date: Wed, 3 Jul 2024 17:47:41 -0400 Subject: [PATCH 01/16] add JetBrains configs to .gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 80b2ee324..238a9947a 100644 --- a/.gitignore +++ b/.gitignore @@ -114,6 +114,10 @@ asv_bench/.asv/ # VS Code .vscode/ +# PyCharm +.idea/ + +# dask dask-worker-space # End of https://www.gitignore.io/api/python From a90db3f10525c7cdf5115f52c729d9d6fbaf8788 Mon Sep 17 00:00:00 2001 From: Zeitsperre <10819524+Zeitsperre@users.noreply.github.com> Date: Wed, 3 Jul 2024 17:48:16 -0400 Subject: [PATCH 02/16] add toml sorting and hardcode flake8 config to pre-commit --- .pre-commit-config.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e0c08fcea..10b7a292f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,6 +21,11 @@ repos: exclude: '.ipynb|asv.conf.json' - id: trailing-whitespace + - repo: https://github.com/pappasam/toml-sort + rev: v0.23.1 + hooks: + - id: toml-sort-fix + - repo: https://github.com/psf/black-pre-commit-mirror rev: 24.4.2 hooks: @@ -30,6 +35,7 @@ repos: rev: 7.1.0 hooks: - id: flake8 + args: [ '--max-line-length=93', '--extend-ignore=W503' ] - repo: https://github.com/PyCQA/isort rev: 5.13.2 From 4dd1a3376c06e027efb7b5af24187ae450f2b813 Mon Sep 17 00:00:00 2001 From: Zeitsperre <10819524+Zeitsperre@users.noreply.github.com> Date: Wed, 3 Jul 2024 17:48:51 -0400 Subject: [PATCH 03/16] move description into top-level import file of library --- climpred/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/climpred/__init__.py b/climpred/__init__.py index 6e3de9023..13aa1d8c3 100644 --- a/climpred/__init__.py +++ b/climpred/__init__.py @@ -1,4 +1,5 @@ # flake8: noqa +"""Verification of weather and climate forecasts and prediction.""" from importlib.metadata import PackageNotFoundError, version as _get_version from . import ( From 648d515d74dfbf19aab8584749d60d05f5d9dd35 Mon Sep 17 00:00:00 2001 From: Zeitsperre <10819524+Zeitsperre@users.noreply.github.com> Date: Wed, 3 Jul 2024 17:49:26 -0400 Subject: [PATCH 04/16] migrate package metadata and configurations to pyproject.toml --- pyproject.toml | 155 +++++++++++++++++++++++++++++++++++++++++++---- requirements.txt | 8 --- setup.cfg | 109 --------------------------------- setup.py | 79 ------------------------ 4 files changed, 144 insertions(+), 207 deletions(-) delete mode 100644 requirements.txt delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml index 09c112759..8c51a282d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,14 +1,147 @@ +[build-system] +requires = [ + "setuptools>=64", + "setuptools_scm>=8", + "wheel" +] +build-backend = "setuptools.build_meta" + +[project] +name = "climpred" +authors = [ + {name = "Aaron Spring", email = "aaron.spring@mpimet.mpg.de"}, + {name = "Riley Brady", email = "riley.brady@colorado.edu"} +] +maintainers = [ + {name = "Aaron Spring", email = "aaron.spring@mpimet.mpg.de"}, + {name = "Trevor James Smith", email = "smith.trevorj@ouranos.ca"} +] +readme = "README.rst" +license = {file = "LICENSE"} +requires-python = ">=3.8" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Education", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Natural Language :: English", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Scientific/Engineering :: Atmospheric Science" +] +dependencies = [ + "cf_xarray>=0.6.0", + "cftime>=1.5.0", + "dask>=2021.10.0", + "numpy>=1.25.0", + "packaging", + "pooch>=1.4", + "xarray>=0.19.0", + "xskillscore>=0.0.20" +] +dynamic = ["version", "description"] + +[project.optional-dependencies] +accel = ["numba>=0.52", "bottleneck"] +bias-correction = ["xclim>=0.46", "bias-correction>=0.4"] +io = ["netcdf4"] # use h5netcdf when encountering seg faults as in GitHub Actions CI +regridding = ["xesmf"] # for installation see https://pangeo-xesmf.readthedocs.io/ +relative_entropy = ["eofs"] +test = ["netcdf4", "pre-commit", "pytest<8", "pytest-cov", "pytest-lazy-fixture", "pytest-xdist"] +viz = ["matplotlib", "nc-time-axis>=1.4.0"] +vwmp = ["xrft"] +docs = ["myst_nb", "sphinx", "sphinx-copybutton", "sphinx-book-theme>=0.3.3", "sphinxcontrib-bibtex", "sphinxcontrib-napoleon", "numba>=0.52", "bottleneck", "xclim>=0.46", "bias-correction>=0.4", "matplotlib", "nc-time-axis>=1.4.0", "netcdf4", "eofs", "xrft"] +complete = ["climpred[accel,bias-correction,viz,io,test,relative_entropy,vwmp]"] + +[project.urls] +"Homepage" = "https://climpred.readthedocs.io/en/stable/" +"Source" = "https://github.com/pangeo-data/climpred" +"Changelog" = "https://climpred.readthedocs.io/en/stable/changelog.html" +"Issue Tracker" = "https://github.com/pangeo-data/climpred/issues" + [tool.black] line-length = 88 -[build-system] - requires = [ - "setuptools>=42", - "wheel", - "setuptools_scm[toml]>=3.4", - "setuptools_scm_git_archive", - ] - build-backend = "setuptools.build_meta" - - [tool.setuptools_scm] - fallback_version = "999" +[tool.isort] +known_first_party = "climpred" +multi_line_output = 3 +include_trailing_comma = true +force_grid_wrap = 0 +use_parentheses = true +line_length = 88 +combine_as_imports = true +skip = [ + "docs/source/conf.py" +] + +[tool.mypy] +exclude = "asv_bench|doc" +files = "." +show_error_codes = true +ignore_missing_imports = true + +[tool.mypy.overrides] +"bottleneck.*" = {ignore_missing_imports = true} +"cftime.*" = {ignore_missing_imports = true} +"mypy-dask.*" = {ignore_missing_imports = true} +"mypy-distributed.*" = {ignore_missing_imports = true} +"mypy-fsspec.*" = {ignore_missing_imports = true} +"mypy-matplotlib.*" = {ignore_missing_imports = true} +"mypy-nc_time_axis.*" = {ignore_missing_imports = true} +"mypy-numpy.*" = {ignore_missing_imports = true} +"mypy-netCDF4.*" = {ignore_missing_imports = true} +"mypy-pandas.*" = {ignore_missing_imports = true} +"mypy-pytest.*" = {ignore_missing_imports = true} +"mypy-scipy.*" = {ignore_missing_imports = true} +"mypy-setuptools" = {ignore_missing_imports = true} +"mypy-toolz.*" = {ignore_missing_imports = true} + +[tool.pytest.ini_options] +python_files = ["test_*.py"] +addopts = [ + "--color=yes", + "--verbose" +] +testpaths = [ + "climpred/tests" +] +filterwarnings = [ + # xarray + "ignore: Using a non-tuple sequence for multidimensional indexing is deprecated:FutureWarning", + # upstream xarray + "ignore: Mean of empty slice:RuntimeWarning", + # only shows up during CI: no idea where its coming from, something inside bootstrapping + "ignore: `np.alen` is deprecated, use `len` instead:DeprecationWarning", + # ignore UserWarnings raise by warnings.warn() which do not break functionality + # therefore ignore in testing + "ignore::UserWarning", + # xarray + "ignore: tostring:DeprecationWarning", + # properscoring + "ignore: invalid value encountered:RuntimeWarning", + "ignore: divide by zero:RuntimeWarning", + # xarray + "ignore: 'base' in .resample():FutureWarning", + # matplotlib + "ignore: More than 20 figures:RuntimeWarning", + # numpy https://stackoverflow.com/questions/40659212/futurewarning-elementwise-comparison-failed-returning-scalar-but-in-the-futur#46721064 + "ignore: elementwise comparison failed", + # pydap + "ignore: Using or importing the ABCs from", + # xarray + "ignore: Passing method to CFTimeIndex.get_loc is deprecated", + # statsmodels + "ignore: pandas.Int64Index is deprecated" +] +markers = [ + "mistral: tests requiring being on MPI supercomputer", + "slow: marks tests as slow (deselect with '-m \"not slow\"')" +] + +[tool.setuptools_scm] +fallback_version = "999" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 8fbfcefd8..000000000 --- a/requirements.txt +++ /dev/null @@ -1,8 +0,0 @@ -cf_xarray>=0.6.0 -cftime>=1.5.0 -dask>=2021.10.0 -numpy>=1.25.0 -packaging -pooch>=1.4 -xarray>=0.19.0 -xskillscore>=0.0.20 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 928477613..000000000 --- a/setup.cfg +++ /dev/null @@ -1,109 +0,0 @@ -[bdist_wheel] -universal = 1 - -[flake8] -ignore = W503 -# allowing doctests -max-line-length = 93 - -[black] -line-length = 88 - -[isort] -known_first_party=climpred -multi_line_output=3 -include_trailing_comma=True -force_grid_wrap=0 -use_parentheses=True -line_length = 88 -combine_as_imports=True -skip= - docs/source/conf.py - setup.py - -[tool:pytest] -python_files=test_*.py -addopts = - --color=yes - --verbose -testpaths=climpred/tests -filterwarnings = - # from xarray - ignore:Using a non-tuple sequence for multidimensional indexing is deprecated:FutureWarning - # upstream xarray - ignore: Mean of empty slice:RuntimeWarning - # upstream xarray - ignore:dropping variables using `drop` will be deprecated; using drop_vars is encouraged:PendingDeprecationWarning - # only shows up during CI: no idea where its coming from, something inside bootstrapping - ignore:`np.alen` is deprecated, use `len` instead:DeprecationWarning - # ignore UserWarnings raise by warnings.warn() which do not break functionality - # therefore ignore in testing - ignore::UserWarning - # from xarray - ignore:tostring:DeprecationWarning - # from properscoring - ignore: invalid value encountered:RuntimeWarning - ignore: divide by zero:RuntimeWarning - # from xarray - ignore: 'base' in .resample():FutureWarning - # matplotlib - ignore: More than 20 figures:RuntimeWarning - # numpy https://stackoverflow.com/questions/40659212/futurewarning-elementwise-comparison-failed-returning-scalar-but-in-the-futur#46721064 - ignore: elementwise comparison failed - # pydap - ignore: Using or importing the ABCs from - # xarray - ignore: Passing method to CFTimeIndex.get_loc is deprecated - # statsmodels - ignore: pandas.Int64Index is deprecated -markers = - mistral: tests requiring being on MPI supercomputer - markers = - slow: marks tests as slow (deselect with '-m "not slow"') - serial - -[aliases] -test = pytest - -[doc8] -max-line-length=88 -ignore-path=climpred/tests - -[mypy] -exclude = asv_bench|doc -files = . -show_error_codes = True - -# Most of the numerical computing stack doesn't have type annotations yet. -[mypy-bottleneck.*] -ignore_missing_imports = True -[mypy-cftime.*] -ignore_missing_imports = True -[mypy-dask.*] -ignore_missing_imports = True -[mypy-distributed.*] -ignore_missing_imports = True -[mypy-fsspec.*] -ignore_missing_imports = True -[mypy-matplotlib.*] -ignore_missing_imports = True -[mypy-nc_time_axis.*] -ignore_missing_imports = True -[mypy-numpy.*] -ignore_missing_imports = True -[mypy-netCDF4.*] -ignore_missing_imports = True -[mypy-pandas.*] -ignore_missing_imports = True -[mypy-pytest.*] -ignore_missing_imports = True -[mypy-scipy.*] -ignore_missing_imports = True -[mypy-setuptools] -ignore_missing_imports = True -[mypy-toolz.*] -ignore_missing_imports = True -# version spanning code is hard to type annotate (and most of this module will -# be going away soon anyways) -[mypy-xarray.core.pycompat] -ignore_errors = True diff --git a/setup.py b/setup.py deleted file mode 100644 index 07c59210e..000000000 --- a/setup.py +++ /dev/null @@ -1,79 +0,0 @@ -from os.path import exists - -from setuptools import find_packages, setup - -if exists("README.rst"): - with open("README.rst") as f: - long_description = f.read() -else: - long_description = "" - -with open("requirements.txt") as f: - install_requires = f.read().strip().split("\n") - -CLASSIFIERS = [ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Education", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: MIT License", - "Natural Language :: English", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Topic :: Scientific/Engineering :: Atmospheric Science", -] - -extras_require = { - "accel": ["numba>=0.52", "bottleneck"], - "bias-correction": ["xclim>=0.46", "bias-correction>=0.4"], - "viz": ["matplotlib", "nc-time-axis>=1.4.0"], - "io": ["netcdf4"], # use h5netcdf when encountering seg faults as in GHA CI - "regridding": [ - "xesmf" - ], # for installation see https://pangeo-xesmf.readthedocs.io/ - "relative_entropy": ["eofs"], - "vwmp": ["xrft"], -} -extras_require["complete"] = sorted({v for req in extras_require.values() for v in req}) -extras_require["complete"].remove( - "xesmf" -) # circumventing esmpy/xesmf installation issues; use conda -# after complete is set, add in test -extras_require["test"] = [ - "netcdf4", - "pre-commit", - "pytest<8", - "pytest-cov", - "pytest-lazy-fixture", - "pytest-xdist", -] -extras_require["docs"] = extras_require["complete"] + [ - "myst_nb", - "sphinx", - "sphinx-copybutton", - "sphinx-book-theme>=0.3.3", - "sphinxcontrib-bibtex", - "sphinxcontrib-napoleon", -] - -setup( - maintainer="Aaron Spring", - maintainer_email="aaron.spring@mpimet.mpg.de", - description="Verification of weather and climate forecasts." + " prediction.", - install_requires=install_requires, - python_requires=">=3.8", - license="MIT", - long_description=long_description, - classifiers=CLASSIFIERS, - name="climpred", - packages=find_packages(), - test_suite="climpred/tests", - tests_require=["pytest"], - url="https://github.com/pangeo-data/climpred", - use_scm_version={"version_scheme": "post-release", "local_scheme": "dirty-tag"}, - zip_safe=False, - extras_require=extras_require, -) From 20a46c95deb1dd24355049e0f41e62db08098f8d Mon Sep 17 00:00:00 2001 From: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> Date: Thu, 4 Jul 2024 12:13:35 -0400 Subject: [PATCH 05/16] finihs migration of configurations to pyproject.toml --- pyproject.toml | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8c51a282d..e4154fea3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ maintainers = [ {name = "Trevor James Smith", email = "smith.trevorj@ouranos.ca"} ] readme = "README.rst" -license = {file = "LICENSE"} +license = {file = "LICENSE.txt"} requires-python = ">=3.8" classifiers = [ "Development Status :: 5 - Production/Stable", @@ -35,28 +35,36 @@ classifiers = [ "Topic :: Scientific/Engineering :: Atmospheric Science" ] dependencies = [ - "cf_xarray>=0.6.0", - "cftime>=1.5.0", - "dask>=2021.10.0", - "numpy>=1.25.0", + "cf_xarray >=0.6.0", + "cftime >=1.5.0", + "dask >=2021.10.0", + "numpy >=1.25.0", "packaging", - "pooch>=1.4", - "xarray>=0.19.0", - "xskillscore>=0.0.20" + "pooch >=1.4", + "xarray >=0.19.0", + "xskillscore >=0.0.20" ] dynamic = ["version", "description"] [project.optional-dependencies] -accel = ["numba>=0.52", "bottleneck"] -bias-correction = ["xclim>=0.46", "bias-correction>=0.4"] +accel = ["numba >=0.52", "bottleneck"] +bias-correction = ["xclim >=0.46", "bias-correction >=0.4"] io = ["netcdf4"] # use h5netcdf when encountering seg faults as in GitHub Actions CI regridding = ["xesmf"] # for installation see https://pangeo-xesmf.readthedocs.io/ relative_entropy = ["eofs"] -test = ["netcdf4", "pre-commit", "pytest<8", "pytest-cov", "pytest-lazy-fixture", "pytest-xdist"] -viz = ["matplotlib", "nc-time-axis>=1.4.0"] +test = ["netcdf4", "pre-commit", "pytest <8.0.0", "pytest-cov", "pytest-lazy-fixture", "pytest-xdist"] +viz = ["matplotlib", "nc-time-axis >=1.4.0"] vwmp = ["xrft"] -docs = ["myst_nb", "sphinx", "sphinx-copybutton", "sphinx-book-theme>=0.3.3", "sphinxcontrib-bibtex", "sphinxcontrib-napoleon", "numba>=0.52", "bottleneck", "xclim>=0.46", "bias-correction>=0.4", "matplotlib", "nc-time-axis>=1.4.0", "netcdf4", "eofs", "xrft"] complete = ["climpred[accel,bias-correction,viz,io,test,relative_entropy,vwmp]"] +docs = [ + "climpred[complete]", + "myst_nb", + "sphinx", + "sphinx-book-theme >=0.3.3", + "sphinx-copybutton", + "sphinxcontrib-bibtex", + "sphinxcontrib-napoleon" +] [project.urls] "Homepage" = "https://climpred.readthedocs.io/en/stable/" @@ -143,5 +151,10 @@ markers = [ "slow: marks tests as slow (deselect with '-m \"not slow\"')" ] +[tool.setuptools.dynamic] +description = {file = "climpred/__init__.py"} + [tool.setuptools_scm] fallback_version = "999" +version_scheme = "post-release" +local_scheme = "dirty-tag" From 328615a4e0486446f012eb0381a49715ea950c15 Mon Sep 17 00:00:00 2001 From: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> Date: Thu, 4 Jul 2024 12:13:50 -0400 Subject: [PATCH 06/16] remove period --- README.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 0442c3350..324c86597 100644 --- a/README.rst +++ b/README.rst @@ -1,6 +1,6 @@ .. image:: https://i.imgur.com/HPOdOsR.png -Verification of weather and climate forecasts. +Verification of weather and climate forecasts .. Table version of badges inspired by pySTEPS. @@ -128,7 +128,7 @@ You can install the latest release of ``climpred`` using ``pip`` or ``conda``: .. code-block:: bash - pip install climpred[complete] + python -m pip install climpred[complete] .. code-block:: bash @@ -141,7 +141,7 @@ repository or installing directly from GitHub: git clone https://github.com/pangeo-data/climpred.git cd climpred - pip install . --upgrade + python -m pip install . --upgrade .. code-block:: bash From 14851ef730d9ef913bf2bbad21caad93944fad41 Mon Sep 17 00:00:00 2001 From: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> Date: Thu, 4 Jul 2024 12:14:35 -0400 Subject: [PATCH 07/16] migrate climpred package to a src structure --- {climpred => src/climpred}/__init__.py | 0 {climpred => src/climpred}/alignment.py | 0 {climpred => src/climpred}/bias_removal.py | 0 {climpred => src/climpred}/bootstrap.py | 2 +- {climpred => src/climpred}/checks.py | 0 {climpred => src/climpred}/classes.py | 0 {climpred => src/climpred}/comparisons.py | 0 {climpred => src/climpred}/conftest.py | 0 {climpred => src/climpred}/constants.py | 0 {climpred => src/climpred}/exceptions.py | 0 {climpred => src/climpred}/graphics.py | 0 {climpred => src/climpred}/horizon.py | 0 {climpred => src/climpred}/logging.py | 0 {climpred => src/climpred}/metrics.py | 0 {climpred => src/climpred}/options.py | 0 {climpred => src/climpred}/prediction.py | 0 {climpred => src/climpred}/preprocessing/__init__.py | 0 {climpred => src/climpred}/preprocessing/mpi.py | 0 {climpred => src/climpred}/preprocessing/shared.py | 0 {climpred => src/climpred}/reference.py | 0 {climpred => src/climpred}/relative_entropy.py | 0 {climpred => src/climpred}/smoothing.py | 0 {climpred => src/climpred}/stats.py | 0 {climpred => src/climpred}/testing.py | 0 {climpred => src/climpred}/tests/__init__.py | 0 {climpred => src/climpred}/tests/test_HindcastEnsemble_class.py | 0 .../climpred}/tests/test_PerfectModelEnsemble_class.py | 0 {climpred => src/climpred}/tests/test_PredictionEnsemble.py | 0 {climpred => src/climpred}/tests/test_alignment.py | 0 {climpred => src/climpred}/tests/test_bias_removal.py | 0 {climpred => src/climpred}/tests/test_bootstrap.py | 0 {climpred => src/climpred}/tests/test_checks.py | 0 {climpred => src/climpred}/tests/test_comparisons.py | 0 {climpred => src/climpred}/tests/test_compute_dims.py | 0 {climpred => src/climpred}/tests/test_demo_data.py | 0 {climpred => src/climpred}/tests/test_effective_p_value.py | 0 {climpred => src/climpred}/tests/test_graphics.py | 0 {climpred => src/climpred}/tests/test_hindcast_prediction.py | 0 {climpred => src/climpred}/tests/test_horizon.py | 0 {climpred => src/climpred}/tests/test_lead_time_resolutions.py | 0 {climpred => src/climpred}/tests/test_logging.py | 0 {climpred => src/climpred}/tests/test_map.py | 0 {climpred => src/climpred}/tests/test_metrics.py | 0 {climpred => src/climpred}/tests/test_metrics_perfect.py | 0 {climpred => src/climpred}/tests/test_options.py | 0 .../climpred}/tests/test_perfect_model_prediction.py | 0 {climpred => src/climpred}/tests/test_preprocessing.py | 0 {climpred => src/climpred}/tests/test_probabilistic.py | 0 {climpred => src/climpred}/tests/test_reference.py | 0 {climpred => src/climpred}/tests/test_relative_entropy.py | 0 {climpred => src/climpred}/tests/test_repr.py | 0 {climpred => src/climpred}/tests/test_smoothing.py | 0 {climpred => src/climpred}/tests/test_stats.py | 0 {climpred => src/climpred}/tests/test_uninitialized.py | 0 {climpred => src/climpred}/tests/test_utils.py | 0 {climpred => src/climpred}/tests/test_valid_time.py | 0 {climpred => src/climpred}/tests/test_versioning.py | 0 {climpred => src/climpred}/tutorial.py | 0 {climpred => src/climpred}/utils.py | 0 {climpred => src/climpred}/versioning/__init__.py | 0 {climpred => src/climpred}/versioning/print_versions.py | 0 61 files changed, 1 insertion(+), 1 deletion(-) rename {climpred => src/climpred}/__init__.py (100%) rename {climpred => src/climpred}/alignment.py (100%) rename {climpred => src/climpred}/bias_removal.py (100%) rename {climpred => src/climpred}/bootstrap.py (99%) rename {climpred => src/climpred}/checks.py (100%) rename {climpred => src/climpred}/classes.py (100%) rename {climpred => src/climpred}/comparisons.py (100%) rename {climpred => src/climpred}/conftest.py (100%) rename {climpred => src/climpred}/constants.py (100%) rename {climpred => src/climpred}/exceptions.py (100%) rename {climpred => src/climpred}/graphics.py (100%) rename {climpred => src/climpred}/horizon.py (100%) rename {climpred => src/climpred}/logging.py (100%) rename {climpred => src/climpred}/metrics.py (100%) rename {climpred => src/climpred}/options.py (100%) rename {climpred => src/climpred}/prediction.py (100%) rename {climpred => src/climpred}/preprocessing/__init__.py (100%) rename {climpred => src/climpred}/preprocessing/mpi.py (100%) rename {climpred => src/climpred}/preprocessing/shared.py (100%) rename {climpred => src/climpred}/reference.py (100%) rename {climpred => src/climpred}/relative_entropy.py (100%) rename {climpred => src/climpred}/smoothing.py (100%) rename {climpred => src/climpred}/stats.py (100%) rename {climpred => src/climpred}/testing.py (100%) rename {climpred => src/climpred}/tests/__init__.py (100%) rename {climpred => src/climpred}/tests/test_HindcastEnsemble_class.py (100%) rename {climpred => src/climpred}/tests/test_PerfectModelEnsemble_class.py (100%) rename {climpred => src/climpred}/tests/test_PredictionEnsemble.py (100%) rename {climpred => src/climpred}/tests/test_alignment.py (100%) rename {climpred => src/climpred}/tests/test_bias_removal.py (100%) rename {climpred => src/climpred}/tests/test_bootstrap.py (100%) rename {climpred => src/climpred}/tests/test_checks.py (100%) rename {climpred => src/climpred}/tests/test_comparisons.py (100%) rename {climpred => src/climpred}/tests/test_compute_dims.py (100%) rename {climpred => src/climpred}/tests/test_demo_data.py (100%) rename {climpred => src/climpred}/tests/test_effective_p_value.py (100%) rename {climpred => src/climpred}/tests/test_graphics.py (100%) rename {climpred => src/climpred}/tests/test_hindcast_prediction.py (100%) rename {climpred => src/climpred}/tests/test_horizon.py (100%) rename {climpred => src/climpred}/tests/test_lead_time_resolutions.py (100%) rename {climpred => src/climpred}/tests/test_logging.py (100%) rename {climpred => src/climpred}/tests/test_map.py (100%) rename {climpred => src/climpred}/tests/test_metrics.py (100%) rename {climpred => src/climpred}/tests/test_metrics_perfect.py (100%) rename {climpred => src/climpred}/tests/test_options.py (100%) rename {climpred => src/climpred}/tests/test_perfect_model_prediction.py (100%) rename {climpred => src/climpred}/tests/test_preprocessing.py (100%) rename {climpred => src/climpred}/tests/test_probabilistic.py (100%) rename {climpred => src/climpred}/tests/test_reference.py (100%) rename {climpred => src/climpred}/tests/test_relative_entropy.py (100%) rename {climpred => src/climpred}/tests/test_repr.py (100%) rename {climpred => src/climpred}/tests/test_smoothing.py (100%) rename {climpred => src/climpred}/tests/test_stats.py (100%) rename {climpred => src/climpred}/tests/test_uninitialized.py (100%) rename {climpred => src/climpred}/tests/test_utils.py (100%) rename {climpred => src/climpred}/tests/test_valid_time.py (100%) rename {climpred => src/climpred}/tests/test_versioning.py (100%) rename {climpred => src/climpred}/tutorial.py (100%) rename {climpred => src/climpred}/utils.py (100%) rename {climpred => src/climpred}/versioning/__init__.py (100%) rename {climpred => src/climpred}/versioning/print_versions.py (100%) diff --git a/climpred/__init__.py b/src/climpred/__init__.py similarity index 100% rename from climpred/__init__.py rename to src/climpred/__init__.py diff --git a/climpred/alignment.py b/src/climpred/alignment.py similarity index 100% rename from climpred/alignment.py rename to src/climpred/alignment.py diff --git a/climpred/bias_removal.py b/src/climpred/bias_removal.py similarity index 100% rename from climpred/bias_removal.py rename to src/climpred/bias_removal.py diff --git a/climpred/bootstrap.py b/src/climpred/bootstrap.py similarity index 99% rename from climpred/bootstrap.py rename to src/climpred/bootstrap.py index 066b60c7f..4ef60a2a2 100644 --- a/climpred/bootstrap.py +++ b/src/climpred/bootstrap.py @@ -394,7 +394,7 @@ def _maybe_auto_chunk(ds, dims): xr.Dataset: auto-chunked along `dims` """ - if dask.is_dask_collection(ds) and dims is not []: + if dask.is_dask_collection(ds) and dims != []: if isinstance(dims, str): dims = [dims] chunks = [d for d in dims if d in ds.dims] diff --git a/climpred/checks.py b/src/climpred/checks.py similarity index 100% rename from climpred/checks.py rename to src/climpred/checks.py diff --git a/climpred/classes.py b/src/climpred/classes.py similarity index 100% rename from climpred/classes.py rename to src/climpred/classes.py diff --git a/climpred/comparisons.py b/src/climpred/comparisons.py similarity index 100% rename from climpred/comparisons.py rename to src/climpred/comparisons.py diff --git a/climpred/conftest.py b/src/climpred/conftest.py similarity index 100% rename from climpred/conftest.py rename to src/climpred/conftest.py diff --git a/climpred/constants.py b/src/climpred/constants.py similarity index 100% rename from climpred/constants.py rename to src/climpred/constants.py diff --git a/climpred/exceptions.py b/src/climpred/exceptions.py similarity index 100% rename from climpred/exceptions.py rename to src/climpred/exceptions.py diff --git a/climpred/graphics.py b/src/climpred/graphics.py similarity index 100% rename from climpred/graphics.py rename to src/climpred/graphics.py diff --git a/climpred/horizon.py b/src/climpred/horizon.py similarity index 100% rename from climpred/horizon.py rename to src/climpred/horizon.py diff --git a/climpred/logging.py b/src/climpred/logging.py similarity index 100% rename from climpred/logging.py rename to src/climpred/logging.py diff --git a/climpred/metrics.py b/src/climpred/metrics.py similarity index 100% rename from climpred/metrics.py rename to src/climpred/metrics.py diff --git a/climpred/options.py b/src/climpred/options.py similarity index 100% rename from climpred/options.py rename to src/climpred/options.py diff --git a/climpred/prediction.py b/src/climpred/prediction.py similarity index 100% rename from climpred/prediction.py rename to src/climpred/prediction.py diff --git a/climpred/preprocessing/__init__.py b/src/climpred/preprocessing/__init__.py similarity index 100% rename from climpred/preprocessing/__init__.py rename to src/climpred/preprocessing/__init__.py diff --git a/climpred/preprocessing/mpi.py b/src/climpred/preprocessing/mpi.py similarity index 100% rename from climpred/preprocessing/mpi.py rename to src/climpred/preprocessing/mpi.py diff --git a/climpred/preprocessing/shared.py b/src/climpred/preprocessing/shared.py similarity index 100% rename from climpred/preprocessing/shared.py rename to src/climpred/preprocessing/shared.py diff --git a/climpred/reference.py b/src/climpred/reference.py similarity index 100% rename from climpred/reference.py rename to src/climpred/reference.py diff --git a/climpred/relative_entropy.py b/src/climpred/relative_entropy.py similarity index 100% rename from climpred/relative_entropy.py rename to src/climpred/relative_entropy.py diff --git a/climpred/smoothing.py b/src/climpred/smoothing.py similarity index 100% rename from climpred/smoothing.py rename to src/climpred/smoothing.py diff --git a/climpred/stats.py b/src/climpred/stats.py similarity index 100% rename from climpred/stats.py rename to src/climpred/stats.py diff --git a/climpred/testing.py b/src/climpred/testing.py similarity index 100% rename from climpred/testing.py rename to src/climpred/testing.py diff --git a/climpred/tests/__init__.py b/src/climpred/tests/__init__.py similarity index 100% rename from climpred/tests/__init__.py rename to src/climpred/tests/__init__.py diff --git a/climpred/tests/test_HindcastEnsemble_class.py b/src/climpred/tests/test_HindcastEnsemble_class.py similarity index 100% rename from climpred/tests/test_HindcastEnsemble_class.py rename to src/climpred/tests/test_HindcastEnsemble_class.py diff --git a/climpred/tests/test_PerfectModelEnsemble_class.py b/src/climpred/tests/test_PerfectModelEnsemble_class.py similarity index 100% rename from climpred/tests/test_PerfectModelEnsemble_class.py rename to src/climpred/tests/test_PerfectModelEnsemble_class.py diff --git a/climpred/tests/test_PredictionEnsemble.py b/src/climpred/tests/test_PredictionEnsemble.py similarity index 100% rename from climpred/tests/test_PredictionEnsemble.py rename to src/climpred/tests/test_PredictionEnsemble.py diff --git a/climpred/tests/test_alignment.py b/src/climpred/tests/test_alignment.py similarity index 100% rename from climpred/tests/test_alignment.py rename to src/climpred/tests/test_alignment.py diff --git a/climpred/tests/test_bias_removal.py b/src/climpred/tests/test_bias_removal.py similarity index 100% rename from climpred/tests/test_bias_removal.py rename to src/climpred/tests/test_bias_removal.py diff --git a/climpred/tests/test_bootstrap.py b/src/climpred/tests/test_bootstrap.py similarity index 100% rename from climpred/tests/test_bootstrap.py rename to src/climpred/tests/test_bootstrap.py diff --git a/climpred/tests/test_checks.py b/src/climpred/tests/test_checks.py similarity index 100% rename from climpred/tests/test_checks.py rename to src/climpred/tests/test_checks.py diff --git a/climpred/tests/test_comparisons.py b/src/climpred/tests/test_comparisons.py similarity index 100% rename from climpred/tests/test_comparisons.py rename to src/climpred/tests/test_comparisons.py diff --git a/climpred/tests/test_compute_dims.py b/src/climpred/tests/test_compute_dims.py similarity index 100% rename from climpred/tests/test_compute_dims.py rename to src/climpred/tests/test_compute_dims.py diff --git a/climpred/tests/test_demo_data.py b/src/climpred/tests/test_demo_data.py similarity index 100% rename from climpred/tests/test_demo_data.py rename to src/climpred/tests/test_demo_data.py diff --git a/climpred/tests/test_effective_p_value.py b/src/climpred/tests/test_effective_p_value.py similarity index 100% rename from climpred/tests/test_effective_p_value.py rename to src/climpred/tests/test_effective_p_value.py diff --git a/climpred/tests/test_graphics.py b/src/climpred/tests/test_graphics.py similarity index 100% rename from climpred/tests/test_graphics.py rename to src/climpred/tests/test_graphics.py diff --git a/climpred/tests/test_hindcast_prediction.py b/src/climpred/tests/test_hindcast_prediction.py similarity index 100% rename from climpred/tests/test_hindcast_prediction.py rename to src/climpred/tests/test_hindcast_prediction.py diff --git a/climpred/tests/test_horizon.py b/src/climpred/tests/test_horizon.py similarity index 100% rename from climpred/tests/test_horizon.py rename to src/climpred/tests/test_horizon.py diff --git a/climpred/tests/test_lead_time_resolutions.py b/src/climpred/tests/test_lead_time_resolutions.py similarity index 100% rename from climpred/tests/test_lead_time_resolutions.py rename to src/climpred/tests/test_lead_time_resolutions.py diff --git a/climpred/tests/test_logging.py b/src/climpred/tests/test_logging.py similarity index 100% rename from climpred/tests/test_logging.py rename to src/climpred/tests/test_logging.py diff --git a/climpred/tests/test_map.py b/src/climpred/tests/test_map.py similarity index 100% rename from climpred/tests/test_map.py rename to src/climpred/tests/test_map.py diff --git a/climpred/tests/test_metrics.py b/src/climpred/tests/test_metrics.py similarity index 100% rename from climpred/tests/test_metrics.py rename to src/climpred/tests/test_metrics.py diff --git a/climpred/tests/test_metrics_perfect.py b/src/climpred/tests/test_metrics_perfect.py similarity index 100% rename from climpred/tests/test_metrics_perfect.py rename to src/climpred/tests/test_metrics_perfect.py diff --git a/climpred/tests/test_options.py b/src/climpred/tests/test_options.py similarity index 100% rename from climpred/tests/test_options.py rename to src/climpred/tests/test_options.py diff --git a/climpred/tests/test_perfect_model_prediction.py b/src/climpred/tests/test_perfect_model_prediction.py similarity index 100% rename from climpred/tests/test_perfect_model_prediction.py rename to src/climpred/tests/test_perfect_model_prediction.py diff --git a/climpred/tests/test_preprocessing.py b/src/climpred/tests/test_preprocessing.py similarity index 100% rename from climpred/tests/test_preprocessing.py rename to src/climpred/tests/test_preprocessing.py diff --git a/climpred/tests/test_probabilistic.py b/src/climpred/tests/test_probabilistic.py similarity index 100% rename from climpred/tests/test_probabilistic.py rename to src/climpred/tests/test_probabilistic.py diff --git a/climpred/tests/test_reference.py b/src/climpred/tests/test_reference.py similarity index 100% rename from climpred/tests/test_reference.py rename to src/climpred/tests/test_reference.py diff --git a/climpred/tests/test_relative_entropy.py b/src/climpred/tests/test_relative_entropy.py similarity index 100% rename from climpred/tests/test_relative_entropy.py rename to src/climpred/tests/test_relative_entropy.py diff --git a/climpred/tests/test_repr.py b/src/climpred/tests/test_repr.py similarity index 100% rename from climpred/tests/test_repr.py rename to src/climpred/tests/test_repr.py diff --git a/climpred/tests/test_smoothing.py b/src/climpred/tests/test_smoothing.py similarity index 100% rename from climpred/tests/test_smoothing.py rename to src/climpred/tests/test_smoothing.py diff --git a/climpred/tests/test_stats.py b/src/climpred/tests/test_stats.py similarity index 100% rename from climpred/tests/test_stats.py rename to src/climpred/tests/test_stats.py diff --git a/climpred/tests/test_uninitialized.py b/src/climpred/tests/test_uninitialized.py similarity index 100% rename from climpred/tests/test_uninitialized.py rename to src/climpred/tests/test_uninitialized.py diff --git a/climpred/tests/test_utils.py b/src/climpred/tests/test_utils.py similarity index 100% rename from climpred/tests/test_utils.py rename to src/climpred/tests/test_utils.py diff --git a/climpred/tests/test_valid_time.py b/src/climpred/tests/test_valid_time.py similarity index 100% rename from climpred/tests/test_valid_time.py rename to src/climpred/tests/test_valid_time.py diff --git a/climpred/tests/test_versioning.py b/src/climpred/tests/test_versioning.py similarity index 100% rename from climpred/tests/test_versioning.py rename to src/climpred/tests/test_versioning.py diff --git a/climpred/tutorial.py b/src/climpred/tutorial.py similarity index 100% rename from climpred/tutorial.py rename to src/climpred/tutorial.py diff --git a/climpred/utils.py b/src/climpred/utils.py similarity index 100% rename from climpred/utils.py rename to src/climpred/utils.py diff --git a/climpred/versioning/__init__.py b/src/climpred/versioning/__init__.py similarity index 100% rename from climpred/versioning/__init__.py rename to src/climpred/versioning/__init__.py diff --git a/climpred/versioning/print_versions.py b/src/climpred/versioning/print_versions.py similarity index 100% rename from climpred/versioning/print_versions.py rename to src/climpred/versioning/print_versions.py From 2e50abe107e80d8534a3446c16ea2a422936be58 Mon Sep 17 00:00:00 2001 From: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> Date: Thu, 4 Jul 2024 12:29:49 -0400 Subject: [PATCH 08/16] fix metadata --- pyproject.toml | 2 +- src/climpred/__init__.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e4154fea3..659bf9218 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -152,7 +152,7 @@ markers = [ ] [tool.setuptools.dynamic] -description = {file = "climpred/__init__.py"} +description = {file = "src/climpred/__init__.py"} [tool.setuptools_scm] fallback_version = "999" diff --git a/src/climpred/__init__.py b/src/climpred/__init__.py index 13aa1d8c3..6fed9f331 100644 --- a/src/climpred/__init__.py +++ b/src/climpred/__init__.py @@ -1,5 +1,6 @@ -# flake8: noqa """Verification of weather and climate forecasts and prediction.""" + +# flake8: noqa from importlib.metadata import PackageNotFoundError, version as _get_version from . import ( From a528afe0b2c0df0d59eb7967e7daf6a15c094d72 Mon Sep 17 00:00:00 2001 From: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> Date: Thu, 4 Jul 2024 12:57:20 -0400 Subject: [PATCH 09/16] update CI workflows --- .github/workflows/benchmarks.yml | 26 ++++++++++------- .github/workflows/climpred_installs.yml | 10 ++++--- .github/workflows/climpred_testing.yml | 29 ++++++++++++------- .github/workflows/publish-production-pypi.yml | 2 +- .../workflows/publish-staging-testpypi.yml | 2 +- .github/workflows/upstream-dev-ci.yml | 2 +- 6 files changed, 44 insertions(+), 27 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index c3b07ebbc..6aca49db1 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -10,10 +10,15 @@ jobs: benchmark: if: ${{ contains( github.event.pull_request.labels.*.name, 'run-benchmark') && github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} name: Linux - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest env: ASV_DIR: "./asv_bench" - + defaults: + run: + shell: bash -l {0} + strategy: + matrix: + python-version: ["3.10"] steps: # We need the full repo to avoid this issue # https://github.com/actions/checkout/issues/23 @@ -21,19 +26,20 @@ jobs: with: fetch-depth: 0 - - name: Setup Miniconda - uses: conda-incubator/setup-miniconda@v3 + - name: Set up conda (micromamba) + uses: mamba-org/setup-micromamba@v1 with: - # installer-url: https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh - installer-url: https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh + environment-name: climpred-benchmarks + cache-environment: true + create-args: >- + python=${{ matrix.python-version }} + conda - - name: Setup some dependencies - shell: bash -l {0} + - name: Set Up Dependencies run: | - pip install asv + python -m pip install asv sudo apt-get update -y - name: Run benchmarks - shell: bash -l {0} id: benchmark env: OPENBLAS_NUM_THREADS: 1 diff --git a/.github/workflows/climpred_installs.yml b/.github/workflows/climpred_installs.yml index 40294610e..7b22c1589 100644 --- a/.github/workflows/climpred_installs.yml +++ b/.github/workflows/climpred_installs.yml @@ -25,7 +25,7 @@ jobs: keyword: "[skip-ci]" install-climpred-complete: # Installs climpred on various OS. - name: Install climpred[complete], ${{ matrix.os }} + name: Install climpred[complete], ${{ matrix.os }}, Python${{ matrix.python-version }} runs-on: ${{ matrix.os }} needs: detect-ci-trigger if: needs.detect-ci-trigger.outputs.triggered == 'false' @@ -33,19 +33,20 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest", "macos-latest", "windows-latest"] + python-version: ["3.9"] steps: - uses: actions/checkout@v4 - name: Setup Python uses: actions/setup-python@v5 with: - python-version: 3.9 + python-version: ${{ matrix.python-version }} - name: Install dependencies run: | pip install -e .[complete] python -c "import climpred" install-climpred: # Installs climpred on various OS. - name: Install climpred, ${{ matrix.os }} + name: Install climpred, ${{ matrix.os }}, Python${{ matrix.python-version }} runs-on: ${{ matrix.os }} needs: detect-ci-trigger if: needs.detect-ci-trigger.outputs.triggered == 'false' @@ -53,6 +54,7 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest", "macos-latest", "windows-latest"] + python-version: ["3.9"] steps: - uses: actions/checkout@v4 with: @@ -60,7 +62,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: 3.9 + python-version: ${{ matrix.python-version }} - name: Install dependencies run: | pip install -e . diff --git a/.github/workflows/climpred_testing.yml b/.github/workflows/climpred_testing.yml index 7f84f6734..e6e0221a1 100644 --- a/.github/workflows/climpred_testing.yml +++ b/.github/workflows/climpred_testing.yml @@ -27,13 +27,16 @@ jobs: keyword: "[skip-ci]" minimum-test: # Runs testing suite with minimal dependencies - name: Test minimum dependencies, Python3.9 + name: Test minimum dependencies, Python${{ matrix.python-version }} runs-on: ubuntu-latest needs: detect-ci-trigger if: needs.detect-ci-trigger.outputs.triggered == 'false' defaults: run: shell: bash -l {0} + strategy: + matrix: + python-version: ["3.9"] steps: - uses: actions/checkout@v4 with: @@ -45,7 +48,7 @@ jobs: environment-name: climpred-minimum-tests cache-environment: true create-args: >- - python=3.9 + python=${{ matrix.python-version }} conda - name: Install climpred run: | @@ -96,9 +99,9 @@ jobs: environment-file: ci/requirements/maximum-tests.yml environment-name: climpred-maximum-tests cache-environment: true - cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{matrix.python-version}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}" + cache-environment-key: "${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python-version }}-${{ env.TODAY }}-${{ hashFiles(env.CONDA_ENV_FILE) }}" create-args: >- - python=${{matrix.python-version}} + python=${{ matrix.python-version }} conda - name: Install climpred[complete] run: | @@ -128,11 +131,14 @@ jobs: fail_ci_if_error: false doctest: # tests all docstrings - name: Doctests, Python3.9 - runs-on: "ubuntu-latest" + name: Doctests, Python${{ matrix.python-version }} + runs-on: ubuntu-latest defaults: run: shell: bash -l {0} + strategy: + matrix: + python-version: ["3.9"] steps: - uses: actions/checkout@v4 - name: Setup conda (micromamba) @@ -142,7 +148,7 @@ jobs: environment-name: climpred-maximum-tests cache-environment: true create-args: >- - python=3.9 + python=${{ matrix.python-version }} conda - name: Install climpred[complete] run: | @@ -156,14 +162,17 @@ jobs: conda list - name: Run doctests run: | - python -m pytest --doctest-modules climpred --ignore climpred/tests + python -m pytest --doctest-modules src/climpred --ignore src/climpred/tests notebooks: # Checks that pre-compiled notebooks in docs still work. - name: Notebooks, Python3.9 + name: Notebooks, Python${{ matrix.python-version }} runs-on: ubuntu-latest defaults: run: shell: bash -l {0} + strategy: + matrix: + python-version: ["3.9"] steps: - uses: actions/checkout@v4 - name: Set up conda (micromamba) @@ -173,7 +182,7 @@ jobs: environment-name: climpred-docs cache-environment: true create-args: >- - python=3.9 + python=${{ matrix.python-version }} conda - name: Install climpred run: | diff --git a/.github/workflows/publish-production-pypi.yml b/.github/workflows/publish-production-pypi.yml index ca775f328..8988b16e1 100644 --- a/.github/workflows/publish-production-pypi.yml +++ b/.github/workflows/publish-production-pypi.yml @@ -17,7 +17,7 @@ jobs: - name: Set up Python3 uses: actions/setup-python@v5 with: - python-version: '3.x' + python-version: "3.x" - name: Install packaging libraries run: | python -m pip install --upgrade pip diff --git a/.github/workflows/publish-staging-testpypi.yml b/.github/workflows/publish-staging-testpypi.yml index 17042ef3a..822cba1c8 100644 --- a/.github/workflows/publish-staging-testpypi.yml +++ b/.github/workflows/publish-staging-testpypi.yml @@ -34,7 +34,7 @@ jobs: - name: Set up Python3 uses: actions/setup-python@v5 with: - python-version: '3.x' + python-version: "3.x" - name: Install packaging libraries run: | python -m pip install --upgrade pip diff --git a/.github/workflows/upstream-dev-ci.yml b/.github/workflows/upstream-dev-ci.yml index 953433c31..7b6bf1c56 100644 --- a/.github/workflows/upstream-dev-ci.yml +++ b/.github/workflows/upstream-dev-ci.yml @@ -28,7 +28,7 @@ jobs: keyword: "[test-upstream]" upstream-dev: - name: upstream-dev + name: upstream-dev, Python${{ matrix.python-version }} runs-on: ubuntu-latest needs: detect-ci-trigger if: | From 54da14bc7e33afed912d50edc463aabbca2f0522 Mon Sep 17 00:00:00 2001 From: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> Date: Thu, 4 Jul 2024 13:43:58 -0400 Subject: [PATCH 10/16] update CHANGELOG.rst --- CHANGELOG.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d70fa3127..55ab93d88 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -22,6 +22,9 @@ Internals/Minor Fixes - Fixed some issues with the documentation build to address rendering errors and reduce the number of warnings on ReadTheDocs. (pr:`843`) `Trevor James Smith`_ - Fixed some issues with the typing hints of classes functions. (pr:`850`) `Trevor James Smith`_ - Fixed several issues with incompatible dependency configurations in the CI and addressed a few deprecations. (pr:`861`) `Trevor James Smith`_ +- `climpred` has adopted `PEP 621 `_ for specifying project metadata. (pr:`862`) `Trevor James Smith`_ +- `climpred` now uses the `src layout `_ for the package file structure. (pr:`862`) `Trevor James Smith`_ + climpred v2.4.0 (2023-11-09) ============================ @@ -224,7 +227,6 @@ Data variables: using :py:func:`~climpred.reference.compute_persistence_from_first_lead`. (:issue:`637`, :pr:`706`) `Aaron Spring`_. - Internals/Minor Fixes --------------------- - Reduce dependencies. (:pr:`686`) `Aaron Spring`_. @@ -1038,6 +1040,7 @@ Documentation - Add page for `publications `_ and `helpful links `_. (:pr:`270`) `Riley X. Brady`_. + climpred v1.1.0 (2019-09-23) ============================ @@ -1072,6 +1075,7 @@ Documentation - Add scope of package to docs for clarity for users and developers. (:pr:`235`) `Riley X. Brady`_. + climpred v1.0.1 (2019-07-04) ============================ From 31bd71a82e1b42ecc39bb63367c5c3a29ea47c4a Mon Sep 17 00:00:00 2001 From: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> Date: Thu, 4 Jul 2024 13:55:12 -0400 Subject: [PATCH 11/16] add python3.8 and python3.12 builds --- .github/workflows/climpred_testing.yml | 6 ++++-- pyproject.toml | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/climpred_testing.yml b/.github/workflows/climpred_testing.yml index e6e0221a1..f9212f2d1 100644 --- a/.github/workflows/climpred_testing.yml +++ b/.github/workflows/climpred_testing.yml @@ -36,7 +36,7 @@ jobs: shell: bash -l {0} strategy: matrix: - python-version: ["3.9"] + python-version: ["3.8", "3.9"] steps: - uses: actions/checkout@v4 with: @@ -78,7 +78,6 @@ jobs: strategy: fail-fast: false matrix: - env: [""] include: - env: "climpred-maximum-tests" python-version: "3.9" @@ -89,6 +88,9 @@ jobs: - env: "climpred-maximum-tests-upstream" python-version: "3.11" os: ubuntu-latest + - env: "climpred-maximum-tests" + python-version: "3.12" + os: ubuntu-latest steps: - uses: actions/checkout@v4 with: diff --git a/pyproject.toml b/pyproject.toml index 659bf9218..4260b8d9d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,6 +74,7 @@ docs = [ [tool.black] line-length = 88 +target-version = ["py38", "py39", "py310", "py311", "py312"] [tool.isort] known_first_party = "climpred" From 4b02f286b143343c5c21d220619cdde35b64281a Mon Sep 17 00:00:00 2001 From: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> Date: Thu, 4 Jul 2024 14:06:58 -0400 Subject: [PATCH 12/16] drop Python3.8, add minimal build for Python3.12, test against latest esmpy --- .github/workflows/climpred_testing.yml | 9 +++++++-- ci/requirements/maximum-tests.yml | 4 ++-- pyproject.toml | 5 ++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/climpred_testing.yml b/.github/workflows/climpred_testing.yml index f9212f2d1..af9532850 100644 --- a/.github/workflows/climpred_testing.yml +++ b/.github/workflows/climpred_testing.yml @@ -36,7 +36,7 @@ jobs: shell: bash -l {0} strategy: matrix: - python-version: ["3.8", "3.9"] + python-version: ["3.9", "3.12"] steps: - uses: actions/checkout@v4 with: @@ -81,15 +81,19 @@ jobs: include: - env: "climpred-maximum-tests" python-version: "3.9" + extras: "esmpy=*=mpi*" # Ensures MPI works with version of esmpy. os: ubuntu-latest - env: "climpred-maximum-tests" python-version: "3.10" + extras: "esmpy=*=mpi*" # Ensures MPI works with version of esmpy. os: ubuntu-latest - env: "climpred-maximum-tests-upstream" python-version: "3.11" + extras: "esmpy=*=mpi*" # Ensures MPI works with version of esmpy. os: ubuntu-latest - env: "climpred-maximum-tests" python-version: "3.12" + extras: "esmpy" # MPI is not supported in lastest esmpy conda packages for Python3.12 os: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -103,8 +107,9 @@ jobs: cache-environment: true cache-environment-key: "${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python-version }}-${{ env.TODAY }}-${{ hashFiles(env.CONDA_ENV_FILE) }}" create-args: >- - python=${{ matrix.python-version }} conda + python=${{ matrix.python-version }} + ${{ matrix.extras }} - name: Install climpred[complete] run: | python -m pip install -e .[complete] diff --git a/ci/requirements/maximum-tests.yml b/ci/requirements/maximum-tests.yml index e91ee1a19..fae567524 100644 --- a/ci/requirements/maximum-tests.yml +++ b/ci/requirements/maximum-tests.yml @@ -3,13 +3,13 @@ channels: - conda-forge - nodefaults dependencies: - - python >=3.9 + - python >=3.9,<3.12 - bias_correction - cftime >=1.5.0 - coveralls - dask-core - eofs - - esmpy =*=mpi* # Ensures MPI works with version of esmpy. + # - esmpy =*=mpi* # Ensures MPI works with version of esmpy. # Commented out for CI testing. - h5netcdf - importlib-metadata <8.0.0 # Pin needed for esmpy compatibility. See: https://github.com/pangeo-data/xESMF/issues/374 - matplotlib-base diff --git a/pyproject.toml b/pyproject.toml index 4260b8d9d..e21bc190d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ maintainers = [ ] readme = "README.rst" license = {file = "LICENSE.txt"} -requires-python = ">=3.8" +requires-python = ">=3.9" classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Education", @@ -27,7 +27,6 @@ classifiers = [ "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -74,7 +73,7 @@ docs = [ [tool.black] line-length = 88 -target-version = ["py38", "py39", "py310", "py311", "py312"] +target-version = ["py39", "py310", "py311", "py312"] [tool.isort] known_first_party = "climpred" From 91bfe347be0757450e5456d8d51485b151056e6b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 4 Jul 2024 18:07:31 +0000 Subject: [PATCH 13/16] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/climpred/reference.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/climpred/reference.py b/src/climpred/reference.py index a0ce9b40c..b0cc85639 100644 --- a/src/climpred/reference.py +++ b/src/climpred/reference.py @@ -103,7 +103,9 @@ def climatology( init_lead["time"] = init_lead["time"].to_index().to_datetimeindex() init_lead = init_lead["time"] climatology_day = verif.groupby(f"time.{seasonality_str}").mean() - with warnings.catch_warnings(): # ignore numpy warning https://stackoverflow.com/questions/40659212/futurewarning-elementwise-comparison-failed-returning-scalar-but-in-the-futur#46721064 # noqa: E501 + with ( + warnings.catch_warnings() + ): # ignore numpy warning https://stackoverflow.com/questions/40659212/futurewarning-elementwise-comparison-failed-returning-scalar-but-in-the-futur#46721064 # noqa: E501 warnings.simplefilter(action="ignore", category=FutureWarning) # enlarge times to get climatology_forecast times # this prevents errors if verification.time and hindcast.init are too much apart From 657d73cd4fd8fa5da3d00962ca3de86d5d7d36e8 Mon Sep 17 00:00:00 2001 From: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> Date: Thu, 4 Jul 2024 14:10:11 -0400 Subject: [PATCH 14/16] broaden allowed Python versions --- ci/requirements/maximum-tests.yml | 2 +- ci/requirements/minimum-tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/requirements/maximum-tests.yml b/ci/requirements/maximum-tests.yml index fae567524..cbd66f83d 100644 --- a/ci/requirements/maximum-tests.yml +++ b/ci/requirements/maximum-tests.yml @@ -3,7 +3,7 @@ channels: - conda-forge - nodefaults dependencies: - - python >=3.9,<3.12 + - python >=3.9,<3.13 - bias_correction - cftime >=1.5.0 - coveralls diff --git a/ci/requirements/minimum-tests.yml b/ci/requirements/minimum-tests.yml index d9be0fa2a..a6cd92acd 100644 --- a/ci/requirements/minimum-tests.yml +++ b/ci/requirements/minimum-tests.yml @@ -3,7 +3,7 @@ channels: - conda-forge - nodefaults dependencies: - - python >=3.9,<3.10 + - python >=3.9,<3.13 - cftime >=1.5.0 - coveralls - dask-core From 51d80fee474b0a2c4739a2f35a71ade32bcf803c Mon Sep 17 00:00:00 2001 From: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> Date: Thu, 4 Jul 2024 14:17:21 -0400 Subject: [PATCH 15/16] drop Python3.8 --- CHANGELOG.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 55ab93d88..86fa860d5 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -24,7 +24,7 @@ Internals/Minor Fixes - Fixed several issues with incompatible dependency configurations in the CI and addressed a few deprecations. (pr:`861`) `Trevor James Smith`_ - `climpred` has adopted `PEP 621 `_ for specifying project metadata. (pr:`862`) `Trevor James Smith`_ - `climpred` now uses the `src layout `_ for the package file structure. (pr:`862`) `Trevor James Smith`_ - +- Drop ``python<=3.8`` support. (:pr:`862`) `Trevor James Smith`_. climpred v2.4.0 (2023-11-09) ============================ From ab3b619117eab6ca08eb1cafd854efaaa2bd2344 Mon Sep 17 00:00:00 2001 From: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> Date: Thu, 4 Jul 2024 14:21:46 -0400 Subject: [PATCH 16/16] add upper pin on numpy until xclim supports it --- ci/requirements/docs.yml | 2 +- ci/requirements/maximum-tests.yml | 4 ++-- pyproject.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/requirements/docs.yml b/ci/requirements/docs.yml index d72256738..e0043da2d 100644 --- a/ci/requirements/docs.yml +++ b/ci/requirements/docs.yml @@ -29,7 +29,7 @@ dependencies: - importlib-metadata <8.0.0 # Pin needed for esmpy compatibility. See: https://github.com/pangeo-data/xESMF/issues/374 - nc-time-axis >=1.4.0 - numba >=0.52 - - numpy >=1.25.0 + - numpy >=1.25.0,<2.0.0 # Pin below v2.0.0 until xclim supports it. - xclim - xesmf - xrft diff --git a/ci/requirements/maximum-tests.yml b/ci/requirements/maximum-tests.yml index cbd66f83d..3964f510f 100644 --- a/ci/requirements/maximum-tests.yml +++ b/ci/requirements/maximum-tests.yml @@ -11,10 +11,10 @@ dependencies: - eofs # - esmpy =*=mpi* # Ensures MPI works with version of esmpy. # Commented out for CI testing. - h5netcdf - - importlib-metadata <8.0.0 # Pin needed for esmpy compatibility. See: https://github.com/pangeo-data/xESMF/issues/374 + - importlib-metadata <8.0.0 # Pin needed for esmpy compatibility. See: https://github.com/pangeo-data/xESMF/issues/374 - matplotlib-base - nc-time-axis >=1.4.0 - - numpy >=1.25.0 + - numpy >=1.25.0,<2.0.0 # Pin below v2.0.0 until xclim supports it. - pip - pooch - pytest <8.0.0 diff --git a/pyproject.toml b/pyproject.toml index e21bc190d..2d9c6391c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,7 @@ dynamic = ["version", "description"] [project.optional-dependencies] accel = ["numba >=0.52", "bottleneck"] -bias-correction = ["xclim >=0.46", "bias-correction >=0.4"] +bias-correction = ["xclim >=0.46", "bias-correction >=0.4", "numpy >=1.25.0,<2.0.0"] # pinned until xclim supports numpy>=2.0.0 io = ["netcdf4"] # use h5netcdf when encountering seg faults as in GitHub Actions CI regridding = ["xesmf"] # for installation see https://pangeo-xesmf.readthedocs.io/ relative_entropy = ["eofs"]