• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Ouranosinc / xclim / 18724559829
92%

Build:
DEFAULT BRANCH: main
Ran 22 Oct 2025 05:35PM UTC
Jobs 0
Files 0
Run time –
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
18724559829

push

github

web-flow
Better relative humidity - allow `invalid_values` (#2254)

<!--Please ensure the PR fulfills the following requirements! -->
<!-- If this is your first PR, make sure to add your details to the
AUTHORS.rst! -->
### Pull Request Checklist:
- [ ] This PR addresses an already opened issue (for bug fixes /
features)
    - This PR fixes #xyz
- [x] Tests for the changes have been added (for bug fixes / features)
- [x] (If applicable) Documentation has been added / updated (for bug
fixes / features)
- [x] CHANGELOG.rst has been updated (with summary of main changes)
- [x] Link to issue (:issue:`number`) and pull request (:pull:`number`)
has been added

### What kind of change does this PR introduce?
The previous way of computing `hurs` from `huss`, `tas` and `ps` was
taking the ratio of the mixing ratios. It seems that is not how it
should be done... MetPy does something similar, but with an added term.

I decided to instead use the base definition : hurs is the ratio of
vapor pressure to saturation vapor pressure. It corresponds to a WMO
equation to, so that's better. I can't find where I took the previous
equation. It's been 5 years and we were not adding references are
thoroughly back then.

I harmonized the $$\epsilon$$ constant (molecular weight ratio of vapor
to dry air) to 0.62198, the value the WMO uses.

Also, I exposed the `invalid_values` to the `relative_humidity`
indicator. So instead of masking hurs > 100, one can now either leave
them be (None) or clip to 100 ('clip').

### Does this PR introduce a breaking change?
Yes as the output has changed. The change is small, but large enough for
some use cases.

### Other information:

$w$ is the mixing ratio, $w_{sat}$ the saturated mixing ratio, $q$ the
specific humidity, $p$ the pressure, $T$ the temperature. $P_w$ the
vapor pressure, $P_{wsat}$ the saturation vapor pressure. $\epsilon =
0.62198$ the molecular weight ratio of vapor to dry air, a constant.

```math
w = \frac{q}{1-q},    w_{sat} = \eps... (continued)
Source Files on build 18724559829
Detailed source file information is not available for this build.
  • Back to Repo
  • 4a5cdcbf on github
  • Prev Build on main (#18599916793)
  • Next Build on main (#18886590555)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc