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

Option to cap low winds to 0.5 m/s #1635

Merged
merged 7 commits into from
Feb 7, 2024
Merged

Option to cap low winds to 0.5 m/s #1635

merged 7 commits into from
Feb 7, 2024

Conversation

profesorpaiche
Copy link
Contributor

@profesorpaiche profesorpaiche commented Feb 3, 2024

Pull Request Checklist:

  • This PR addresses an already opened issue (for bug fixes / features)
  • Tests for the changes have been added (for bug fixes / features)
    • (If applicable) Documentation has been added / updated (for bug fixes / features)
  • CHANGES.rst has been updated (with summary of main changes)
    • Link to issue (:issue:number) and pull request (:pull:number) has been added

What kind of change does this PR introduce?

  • Adds an option to the universal_thermal_climate_index function to cap low wind to a minimum of 0.5 m/s

Does this PR introduce a breaking change?

  • No

Other information:

References for the change:

Copy link

github-actions bot commented Feb 3, 2024

Welcome, new contributor!

It appears that this is your first Pull Request. To give credit where it's due, we ask that you add your information to the AUTHORS.rst and .zenodo.json:

  • The relevant author information has been added to AUTHORS.rst and .zenodo.json

Please make sure you've read our contributing guide. We look forward to reviewing your Pull Request shortly ✨

@github-actions github-actions bot added docs Improvements to documenation indicators Climate indices and indicators labels Feb 3, 2024
@profesorpaiche
Copy link
Contributor Author

  • The relevant author information has been added to AUTHORS.rst and .zenodo.json

Copy link
Collaborator

@Zeitsperre Zeitsperre left a comment

Choose a reason for hiding this comment

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

Nice! Think you could add a really simple test under tests/test_indices.py?

CHANGES.rst Outdated Show resolved Hide resolved
profesorpaiche and others added 4 commits February 5, 2024 17:56
Co-authored-by: Trevor James Smith <[email protected]>
It checks 3 conditions:

1. If the UTCI is similar to the expected value at wind velocity higher than 0.5 m/s (original test)
2. If the UTCI is `NaN` when the wind is lower than 0.5 m/s and `wind_cap_min` is set to `False`
3. If the UTCI is similar to the expected value when the wind velocity is lower than 0.5 m/s and `wind_cap_min` is set to `True`

NOTE: Previous commit perfomed redundant tests
@profesorpaiche
Copy link
Contributor Author

I expanded the original UTCI test by trying two wind values (2 and 1 km/h, or 0.556 and 0.278 m/s) with and without the option to cap the minimum wind velocities. Now the test checks:

  1. If the UTCI is similar to the expected value at wind velocity higher than 0.5 m/s (original test)
  2. If the UTCI is NaN when the wind is lower than 0.5 m/s and wind_cap_min is set to False
  3. If the UTCI is similar to the expected value when the wind velocity is lower than 0.5 m/s and wind_cap_min is set to True

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.

This looks clean. Thanks @profesorpaiche!

Comment on lines 1822 to 1824
wind_cap_min: bool
If True, low wind velocities are capped to a minimum of 0.5 m/s. This ensures
UTCI calculation for low winds. Default value False.
Copy link
Collaborator

@aulemahal aulemahal Feb 6, 2024

Choose a reason for hiding this comment

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

Oh, would it be interesting to cite Bröde 2012 here ? Or below in the "references" section ?
In any case, the metadata for the publication has to be added to "docs/references.bib" before being cited here with :cite:t: or added to the :cite:cts: directive below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think is better to cite Bröde 2012 (and also Bröde 2023 Figure 2) here because the user may want to know a bit more context of this specific option. I will include both in the "docs/reference.bib" file and update the description

@profesorpaiche
Copy link
Contributor Author

Included the article of Bröde 2012 in the description of wind_cap_min. This article is more than enough to explain wind_cap_min so I didn't include Bröde 2023

@Zeitsperre Zeitsperre added the approved Approved for additional tests label Feb 7, 2024
@coveralls
Copy link

Coverage Status

coverage: 90.171% (+0.002%) from 90.169%
when pulling 3ac6c5d on profesorpaiche:utci-low-wind
into 41379c5 on Ouranosinc:master.

@Zeitsperre Zeitsperre merged commit cfd5643 into Ouranosinc:master Feb 7, 2024
16 checks passed
@Zeitsperre
Copy link
Collaborator

@profesorpaiche Thanks for the contribution!

@profesorpaiche profesorpaiche deleted the utci-low-wind branch February 7, 2024 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Approved for additional tests docs Improvements to documenation indicators Climate indices and indicators
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UTCI for low wind velocities
4 participants