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

Fix cftime bug, no fail on pip check, pin xarray/pandas #322

Merged
merged 8 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions .github/workflows/bump-version-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Check versions
run: |
conda list
pip check
pip check || true
- name: Run tests
run: |
make start
Expand Down
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -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`).
Expand Down
2 changes: 2 additions & 0 deletions environment-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 4 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ dependencies:
- python >=3.8,<3.12
- pip
- bottleneck
- cftime
- cf_xarray
- click
- clisops >=0.9.3
- dask
Expand All @@ -13,7 +15,7 @@ dependencies:
- h5netcdf
- netcdf4
- numpy
- pandas
- pandas >=1.5.3,<2.2.0
- parse
- psutil
- python-slugify
Expand All @@ -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
2 changes: 2 additions & 0 deletions finch/processes/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
Expand Down
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ nbsphinx
nbval>=0.9.6
nbconvert
sphinx>=1.8.5
bump2version
bump-my-version
twine
cruft
jupyter_client
Expand Down
8 changes: 6 additions & 2 deletions requirements_docs.txt
Original file line number Diff line number Diff line change
@@ -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