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

Add humidex calc #280

Merged
merged 43 commits into from
Jun 5, 2023
Merged

Add humidex calc #280

merged 43 commits into from
Jun 5, 2023

Conversation

tlogan2000
Copy link
Collaborator

@tlogan2000 tlogan2000 commented Jun 2, 2023

Overview

This PR fixes #278

Changes:

  • Added hxmax_days_above calculation via yml module
  • More globally finch can now support custom yml modules;
  • Exclusion / inclusion of subset of custom modules can be achieved via the config
  • Automatic detection of associated new input variables (e.g. HXmax in this case)

Additional Information

Adding french metadata to the humidex yml could be useful

@github-actions github-actions bot added the dependencies Pull requests that update a dependency file label Jun 2, 2023
@tlogan2000
Copy link
Collaborator Author

Local tests are failing but might be due to updated xclim to 0.43

ImportError while loading conftest '/home/logan/PycharmProjects/finch/tests/conftest.py'.
tests/conftest.py:14: in <module>
    from xclim.testing.tests.conftest import pr_hr_series, pr_series, q_series, tas_series
E   ModuleNotFoundError: No module named 'xclim.testing.tests'

@aulemahal
Copy link
Collaborator

Yeah indeed... You'll need to translate all those "*_series" to calls of https://xclim.readthedocs.io/en/v0.43.0/xclim.testing.html#xclim.testing.helpers.test_timeseries.

You might get inspiration from xscen's brand new test modules : https://github.com/Ouranosinc/xscen/blob/9b070c79762de28007f034743c25fffe52904900/tests/test_aggregate.py

@@ -2,7 +2,7 @@ pywps>=4.5.1
sphinx>=4.0
nbsphinx
ipython
xclim==0.38
xclim==0.43
pint<0.20 # xclim < 0.39 breaks with pint 0.20
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aulemahal indicated that xclim is always pinned in finch?
Also if I wait for #272 then integrate changes will the tests fix themselves?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm talking specifically the pint pin, sorry!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging should fix failures related to h5netcdf and the subset notebook, but not the ones from the "*_series" test helpers, these come from a change posterior to 0.40 (the xclim in 272).

requirements.txt Outdated Show resolved Hide resolved
environment.yml Outdated
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to put an upper pin on python here. Python3.11 is not officially support with some libraries.

Copy link
Collaborator

@aulemahal aulemahal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good overall!

A few changes requested.

This is also missing some documentation, principally in docs/source/configuration.rst.

finch/default.cfg Outdated Show resolved Hide resolved
finch/processes/modules/humidex.yml Outdated Show resolved Hide resolved
finch/processes/utils.py Outdated Show resolved Hide resolved
finch/processes/utils.py Outdated Show resolved Hide resolved
finch/processes/utils.py Outdated Show resolved Hide resolved
finch/processes/wps_xclim_indices.py Outdated Show resolved Hide resolved
finch/processes/wps_xclim_indices.py Outdated Show resolved Hide resolved
tlogan2000 and others added 11 commits June 5, 2023 15:26
@tlogan2000 tlogan2000 requested a review from aulemahal June 5, 2023 20:46
@github-actions github-actions bot added the docs Improvements to documenation label Jun 5, 2023
@tlogan2000
Copy link
Collaborator Author

Seems good overall!

A few changes requested.

This is also missing some documentation, principally in docs/source/configuration.rst.

Added some info to the configuration.rst let me know if it seems ok

@tlogan2000 tlogan2000 merged commit fb7bc8f into master Jun 5, 2023
@tlogan2000 tlogan2000 deleted the add_humidex_calc branch June 5, 2023 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file docs Improvements to documenation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Humidex days over thresh calculation
3 participants