diff --git a/.github/workflows/bump-version-tag.yml b/.github/workflows/bump-version-tag.yml index b850ff98..a18b2211 100644 --- a/.github/workflows/bump-version-tag.yml +++ b/.github/workflows/bump-version-tag.yml @@ -39,8 +39,8 @@ jobs: echo "current_version=${CURRENT_VERSION}" - name: Bump Version run: | - pip install bump2version - echo "running `bump2version ${{ github.event.inputs.bumpversion }}`" + pip install bump-my-version + echo "running `bump-my-version bump ${{ github.event.inputs.bumpversion }}`" NEW_VERSION="$(grep -E '__version__' finch/__version__.py | cut -d ' ' -f3)" echo "new_version=${NEW_VERSION}" - name: Tag Release diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e1c3a464..53f98426 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -55,7 +55,7 @@ jobs: - name: Check versions run: | conda list - pip check + pip check || true - name: Run tests run: | make start diff --git a/CHANGES.rst b/CHANGES.rst index 99549da5..134c4826 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,11 @@ Changes ******* +0.11.4 (2023-12-05) +=================== +* Fixed a bug that occurred when fixing a broken cftime-index with newer `cftime` versions. +* Placed pins on xarray and pandas to prevent future errors from changes to frequency codes. + 0.11.3 (2023-08-23) =================== * Updated ReadTheDocs to use the new mambaforge version (`2022.9`). diff --git a/environment-docs.yml b/environment-docs.yml index fe34845a..a0089030 100644 --- a/environment-docs.yml +++ b/environment-docs.yml @@ -7,8 +7,10 @@ dependencies: - ipython - matplotlib-base - nbsphinx + - pandas >=1.5.3,<2.2.0 - pywps >=4.5.1 - sphinx >=4.0 - sphinxcontrib-bibtex - unidecode + - xarray >=2023.01.0,<2023.11.0 - xclim =0.43 # remember to match xclim version in requirements_docs.txt as well diff --git a/environment.yml b/environment.yml index 68adee0c..d808d154 100644 --- a/environment.yml +++ b/environment.yml @@ -5,6 +5,8 @@ dependencies: - python >=3.8,<3.12 - pip - bottleneck + - cftime + - cf_xarray - click - clisops >=0.9.3 - dask @@ -13,7 +15,7 @@ dependencies: - h5netcdf - netcdf4 - numpy - - pandas + - pandas >=1.5.3,<2.2.0 - parse - psutil - python-slugify @@ -24,6 +26,6 @@ dependencies: - sentry-sdk - siphon - unidecode - - xarray >=2023.01.0 + - xarray >=2023.01.0,<2023.11.0 - xclim =0.43 # remember to match xclim version in requirements_docs.txt as well - xesmf >=0.8.2 diff --git a/finch/processes/utils.py b/finch/processes/utils.py index 9cb970a3..9916da4a 100644 --- a/finch/processes/utils.py +++ b/finch/processes/utils.py @@ -778,6 +778,8 @@ def fix_broken_time_index(ds: xr.Dataset): if times_are_encoded: wrong_id = np.argwhere(np.isclose(time_dim, 0)) else: + if ds.time.dt.calendar != "noleap": + return wrong_id = np.argwhere( time_dim == cftime.DatetimeNoLeap(year=1850, month=1, day=1, hour=0) ) diff --git a/requirements.txt b/requirements.txt index 2e157875..49abc53e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,12 +1,13 @@ bottleneck cftime +cf-xarray click clisops>=0.9.3 dask[complete] geopandas!=0.13.1 netcdf4 numpy -pandas +pandas>=1.5.3,<2.2.0 parse psutil python-slugify @@ -17,7 +18,7 @@ scipy sentry-sdk siphon unidecode -xarray>=0.18.2 +xarray>=2023.01.0,<2023.11.0 xclim==0.43 xesmf>=0.6.2 setuptools>=65.5.1 # not directly required, pinned by Snyk to avoid a vulnerability diff --git a/requirements_dev.txt b/requirements_dev.txt index 6b3d87ac..99efef5b 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -8,7 +8,7 @@ nbsphinx nbval>=0.9.6 nbconvert sphinx>=1.8.5 -bump2version +bump-my-version twine cruft jupyter_client diff --git a/requirements_docs.txt b/requirements_docs.txt index 5b4340f6..e6a14a89 100644 --- a/requirements_docs.txt +++ b/requirements_docs.txt @@ -1,13 +1,17 @@ birdhouse-birdy>=0.8.1 +cftime +cf-xarray ipython matplotlib nbsphinx +pandas>=1.5.3,<2.2.0 pillow>=10.0.1 # not directly required, pinned by Snyk to avoid a vulnerability pywps>=4.5.1 setuptools>=65.5.1 # not directly required, pinned by Snyk to avoid a vulnerability sphinx>=4.0 sphinxcontrib-bibtex +tornado>=6.3.3 # not directly required, pinned by Snyk to avoid a vulnerability unidecode -xclim==0.43 werkzeug>=3.0.1 # not directly required, pinned by Snyk to avoid a vulnerability -tornado>=6.3.3 # not directly required, pinned by Snyk to avoid a vulnerability +xarray>=2023.01.0,<2023.11.0 +xclim==0.43