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

Update xclim #414

Merged
merged 44 commits into from
Dec 18, 2024
Merged

Update xclim #414

merged 44 commits into from
Dec 18, 2024

Conversation

Zeitsperre
Copy link
Collaborator

@Zeitsperre Zeitsperre commented Sep 30, 2024

Overview

Changes:

  • finch is now compatible with the latest xclim (v0.53.2) and xscen (v0.10.1).
  • Python 3.12 is now supported; Python 3.10+ coding conventions are now standard.
  • Python 3.8 and 3.9 support has been dropped.
  • The tempfile management for testing has been significantly improved.

Additional Information

Once this PR is merged and the cookiecutter is updated, we should be able to tag a new version.

@tlogan2000
Copy link
Collaborator

tlogan2000 commented Oct 29, 2024

Moving forward I will need to use xscen for additions to the climatedata.ca analysis page : I have started a branch https://github.com/bird-house/finch/tree/use_xscen. I suggest we merge the two branches togther as they have more or less the same problems right now. Using xscen requirement list becomes simpler as many of the dependencies are bundled together (xclim, clisops, xesmf). However, changes to xclim are currently breaking the creation of wps processes

@aulemahal
Copy link
Collaborator

@tlogan2000 Indeed, there was a dict-like access on a Parameter object, which lost that feature in recent xclim. However, there is also a bug in xclim.

The indicator "frost_free_spell_max_length" has the default ">=" for its parameter op. But in its docstring, it lists the possible choices for op as <, <=, le, lt... A faulty copy-paste I presume. I added a workaround that spits a log error.

@Zeitsperre
Copy link
Collaborator Author

@aulemahal There's still time to fix this bug upstream before the patch release. I'll see if we can get everything together for a release later today.

@aulemahal
Copy link
Collaborator

Yish. I'll leave you the stats / discharge issues, but cf-xarray's reshape_unique_geometries seems completely broken with the newest xarray...

@tlogan2000
Copy link
Collaborator

@Zeitsperre @aulemahal I am starting to implement changes to the spatial averaging section of the ensembles code (using xscen but with this branch as a starting point). Opinions whether I should push these "xscen" changes in this branch directly?

@Zeitsperre
Copy link
Collaborator Author

@tlogan2000 I would make a branch based off of this work. We don't want to mix up the conversion work with the new features if we can. It's bad enough haha

@Zeitsperre Zeitsperre marked this pull request as ready for review December 12, 2024 21:40
@github-actions github-actions bot added the CI Continuous Integration label Dec 12, 2024
@Zeitsperre
Copy link
Collaborator Author

FYI, we're seeing some funny errors on the docker image:

 ERROR:PYWPS:Indicator frost_free_spell_max_length has incorrect choices for parameter op : default >= not in ['<', '<=', 'lt', 'le']
/opt/conda/envs/finch/lib/python3.12/site-packages/xclim/core/locales.py:189: UserWarning: Attributes of indicator HXMAX_DAYS_ABOVE in language fr were requested, but none were found.
/opt/conda/envs/finch/lib/python3.12/site-packages/xclim/core/locales.py:189: UserWarning: Attributes of indicator DISCHARGE_STATS in language fr were requested, but none were found.
/opt/conda/envs/finch/lib/python3.12/site-packages/xclim/core/locales.py:189: UserWarning: Attributes of indicator FREQ_ANALYSIS in language fr were requested, but none were found.
/opt/conda/envs/finch/lib/python3.12/site-packages/xclim/core/locales.py:189: UserWarning: Attributes of indicator DISCHARGE_DISTRIBUTION_FIT in language fr were requested, but none were found.
ERROR:PYWPS:Indicator frost_free_spell_max_length has incorrect choices for parameter op : default >= not in ['<', '<=', 'lt', 'le']
ERROR:PYWPS:Indicator frost_free_spell_max_length has incorrect choices for parameter op : default >= not in ['<', '<=', 'lt', 'le']
ERROR:PYWPS:Indicator frost_free_spell_max_length has incorrect choices for parameter op : default >= not in ['<', '<=', 'lt', 'le']
INFO:PYWPS:Configuration file(s) ['/opt/conda/envs/finch/lib/python3.12/site-packages/finch/default.cfg'] loaded
/opt/conda/envs/finch/lib/python3.12/site-packages/xclim/core/indicator.py:255: UserWarning: Class humidex.HXMAX_DAYS_ABOVE already exists and will be overwritten.
/opt/conda/envs/finch/lib/python3.12/site-packages/xclim/core/indicator.py:255: UserWarning: Class streamflow.DISCHARGE_STATS already exists and will be overwritten.
/opt/conda/envs/finch/lib/python3.12/site-packages/xclim/core/indicator.py:255: UserWarning: Class streamflow.FREQ_ANALYSIS already exists and will be overwritten.
/opt/conda/envs/finch/lib/python3.12/site-packages/xclim/core/indicator.py:255: UserWarning: Class streamflow.DISCHARGE_DISTRIBUTION_FIT already exists and will be overwritten.
ERROR:PYWPS:Indicator frost_free_spell_max_length has incorrect choices for parameter op : default >= not in ['<', '<=', 'lt', 'le']
ERROR:PYWPS:Indicator frost_free_spell_max_length has incorrect choices for parameter op : default >= not in ['<', '<=', 'lt', 'le']
ERROR:PYWPS:Indicator frost_free_spell_max_length has incorrect choices for parameter op : default >= not in ['<', '<=', 'lt', 'le']
ERROR:PYWPS:Indicator frost_free_spell_max_length has incorrect choices for parameter op : default >= not in ['<', '<=', 'lt', 'le']
forked process id: 16
starting WPS service on http://localhost:5000/wps
INFO:werkzeug:WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on http://localhost:5000

Might want to verify firs that there are things we should set in finch before opening issues in xclim.

@aulemahal
Copy link
Collaborator

The "ERROR" lines should be fixed in the latest xclim. The attributes issue I don't know, but who cares. The reloading warnings are ok to ignore.

@github-actions github-actions bot added the docs Improvements to documenation label Dec 17, 2024
@Zeitsperre
Copy link
Collaborator Author

@tlogan2000 I'm preparing a new PR based off this work to get rid of the old build system. Shouldn't take very long.

@tlogan2000 tlogan2000 merged commit d64e0b9 into master Dec 18, 2024
9 checks passed
@tlogan2000 tlogan2000 deleted the update-xclim branch December 18, 2024 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CCDP CI Continuous Integration docs Improvements to documenation help wanted Extra attention is needed priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants