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

Ouranosinc / xclim / 5683966277 / 2
90%
main: 92%

Build:
Build:
LAST BUILD BRANCH: add-ouranos-logo
DEFAULT BRANCH: main
Ran 27 Jul 2023 06:21PM UTC
Files 70
Run time 1s
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 Jul 2023 06:06PM UTC coverage: 90.281% (+0.01%) from 90.268%
5683966277.2

push

github

web-flow
Deterministic randomness (#1442)

<!--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 #1428
- [x] 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?

Added new `random` fixture : it returns a numpy Generator with a
constant seed. All tests using random number generation use that
fixture. Each time the test is run, the same generator is returned, and
it generate the same numbers each time.

Some tests were already using specific seeds, but I tried to use this
new solution everywhere, leading to adjustment of the expected values in
many places.

The KMeans object of `sci-kit learn` doesn't support the conventional
numpy generator, so a specific fixture is created for these tests.

I rewrote some tests, to reduce the number of line and complexity. The
normal bootstrap tests for example have all been merged into one.

### Does this PR introduce a breaking change?
No, it only affects the tests.

### Other information:
I think we have no random generation done inside dask tasks, which
avoids having to implement that.

8212 of 9096 relevant lines covered (90.28%)

0.9 hits per line

Source Files on job run-{{ matrix.tox-env }}-opt-slow - 5683966277.2
  • Tree
  • List 0
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 5683966277
  • f6838a15 on github
  • Prev Job for on master (#5680572103.2)
  • Next Job for on master (#5727954351.1)
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