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

Ouranosinc / xclim / 17269752551 / 5
92%
main: 92%

Build:
DEFAULT BRANCH: main
Ran 27 Aug 2025 02:38PM UTC
Files 61
Run time 4s
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

27 Aug 2025 02:29PM UTC coverage: 88.64% (-0.1%) from 88.735%
17269752551.5

push

github

web-flow
Snowfall and rain approximation from Dai 2008 (#2208)

<!--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:
- [x] This PR addresses an already opened issue (for bug fixes /
features)
    - This PR fixes #1752
- [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?

* New methods "dai_annual" and "dai_seasonal" for snowfall and rain
approximation.
* New argument `landmask` to control which formulation (land or ocean)
we use.

### Does this PR introduce a breaking change?
No. Only new arguments added, no default changed.


### Other information:
@Zeitsperre : The `landmask` argument is polymorphic (my favorite, your
nemesis (?)), it can either be a DataArray (which is assumed to be of
boolean dtype, but no need to check) or a straight boolean. This is not
a `Quantified` because boolean have no units. Right now, I put the
annotation that resolved into the "optional variable" `InputType`, which
means "bool" is not part of it. Should we create a new `InputType` for
boolean mask ? It would be similar to `Quantified` in that it can be a
scalar or a DataArray, but without the units check.


@tlogan2000 : I implemented the rain approximation as well. However, in
opposition to the 3 other methods already implemented, the Dai rain
approximation is not equal to `pr - prsn` because it considers some
small fractions of the total precip to be of another phase (denoted
"sleet" in the article). Thus, to imitate DonnéesClimatiques, ones need
to compute `prra` as `pr - prsn` instead of using `rain_approximation`.
Is this ok ?


Tests need to be ... (continued)

7545 of 8512 relevant lines covered (88.64%)

0.89 hits per line

Source Files on job run-3.11-ubuntu-latest-py311-coverage-extras-sbck-offline-prefetch - 17269752551.5
  • Tree
  • List 61
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 17269752551
  • 20e75d73 on github
  • Prev Job for on main (#17269486543.8)
  • Next Job for on main (#17404725336.2)
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