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

Ouranosinc / xclim / 5094954857
90%
main: 92%

Build:
Build:
LAST BUILD BRANCH: eco-ci-project
DEFAULT BRANCH: main
Ran 26 May 2023 09:14PM UTC
Jobs 2
Files 68
Run time 2s
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
5094954857

push

github

web-flow
Accelerate import - prevent numba warnings (#1378)

<!--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 an issue raised verbally by `xscen` developers.
- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] (If applicable) Documentation has been added / updated (for bug
fixes / features)
- [x] CHANGES.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?

PR #1135 removed all signatures where possible, so that `@jit`-decorated
function would be compiled at run time (you know "just in time"...).
However, `@guvectorize` -decorated functions _must_ have signatures and
thus must be compiled at compile time, which means upon import.

This PR adds `cache=True` to these function, so numba compiles them once
and than saves the compilation to a `__pycache__` folder if possible.
The first import will be slow as before, but subsequent imports should
be much faster.
I'm sure there are edgecases where the user of xclim doesn't have write
access to the source folder, which might mean this caching will be
unavailable. But for most users, this should be a nice performance
boost.

On my machine I went from 13s to 2.5s.

This PR also forces `nopython=True` to these `@guvectorize` functions.
Numba 0.59 will change the default value of this parameter and it was
raising warning complaining about our lack of precision.

### Does this PR introduce a breaking change?
It shouldn't. But I do not know all the ramifications of caching these
functions...

### Other information:
@RondeauG, fyi.

12 of 12 new or added lines in 2 files covered. (100.0%)

7814 of 8625 relevant lines covered (90.6%)

2.63 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-{{ matrix.tox-env }} - 5094954857.1 26 May 2023 09:19PM UTC 0
86.48
2 run-{{ matrix.tox-env }}-opt-slow - 5094954857.2 26 May 2023 09:19PM UTC 0
90.21
Source Files on build 5094954857
Detailed source file information is not available for this build.
  • Back to Repo
  • 21ffe851 on github
  • Prev Build on master (#5026800472)
  • Next Build on master (#5115063007)
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