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

Ouranosinc / xclim / 17269752551
92%

Build:
DEFAULT BRANCH: main
Ran 27 Aug 2025 02:34PM UTC
Jobs 8
Files 61
Run time 1min
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: 92.094% (-0.1%) from 92.21%
17269752551

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)

42 of 57 new or added lines in 2 files covered. (73.68%)

7839 of 8512 relevant lines covered (92.09%)

8.07 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
15
91.62
-1.9% src/xclim/indices/converters.py
Jobs
ID Job ID Ran Files Coverage
1 run-{{ matrix.python-version }}-conda - 17269752551.1 27 Aug 2025 02:38PM UTC 60
91.95
GitHub Action Run
2 run-3.11-ubuntu-latest-standard - 17269752551.2 27 Aug 2025 02:38PM UTC 61
88.77
GitHub Action Run
3 run-3.12-ubuntu-latest-standard - 17269752551.3 27 Aug 2025 02:38PM UTC 61
88.67
GitHub Action Run
4 run-3.11-ubuntu-latest-preliminary - 17269752551.4 27 Aug 2025 02:38PM UTC 61
88.48
GitHub Action Run
5 run-3.11-ubuntu-latest-py311-coverage-extras-sbck-offline-prefetch - 17269752551.5 27 Aug 2025 02:38PM UTC 61
88.64
GitHub Action Run
6 run-3.11-macos-latest-py311-coverage-extras-lmoments - 17269752551.6 27 Aug 2025 02:38PM UTC 61
91.89
GitHub Action Run
7 run-3.12-windows-latest-py312-coverage-prefetch - 17269752551.7 27 Aug 2025 02:38PM UTC 61
88.22
GitHub Action Run
8 run-3.10-ubuntu-latest-standard - 17269752551.8 27 Aug 2025 02:38PM UTC 61
88.67
GitHub Action Run
Source Files on build 17269752551
  • Tree
  • List 61
  • Changed 4
  • Source Changed 4
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 20e75d73 on github
  • Prev Build on main (#17269486543)
  • Next Build on main (#17404725336)
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

© 2025 Coveralls, Inc