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

Ouranosinc / xclim / 8930203821
92%

Build:
DEFAULT BRANCH: main
Ran 02 May 2024 08:49PM UTC
Jobs 2
Files 70
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

02 May 2024 08:42PM UTC coverage: 90.843% (-0.1%) from 90.944%
8930203821

push

github

web-flow
Proper use of `loc` parameter in `gamma`,`fisk` dists (SPI/SPEI) (#1720)

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


* Spei used to rely on an offset to ensure that distribution of values
are positive when using distributions such as `gamma, fisk`. Now,
instead, we properly use the `loc` parameter in those distributions that
generalize the distributions and allow negative values. For instance,
the `gamma` disitribution is a 2-parameter function, but in ``scipy``
it's generalized to 3 parameters, with a `loc` parameter. This extends
the support of `gamma` from $x \in [0,\infty]$ to $x \in [\text{loc},
\infty]$.

The code was already compatible with this idea, just had to change
``_fit_start`` so it can compute estimates of the parameters in the
cases with negatives values.


### Does this PR introduce a breaking change?

* Removing the offset from SPEI. Also, the `_fit_start` can now compute
an estimate of `loc` which can affect what value we obtain when
optimizing 3-parameters distributions. Even when the `loc` is fixed to 0
with `floc=0` in `fitkwargs`, the estimate of `fisk` was modified. The
previous formulation was obtained by applying more or less the idea in
the method of moments, but now I obtained an approximation that's more
rigorous.

* The case of zero inflated distribution has been changed: Now, it is
the calib... (continued)

95 of 111 new or added lines in 3 files covered. (85.59%)

2 existing lines in 1 file now uncovered.

8869 of 9763 relevant lines covered (90.84%)

5.38 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-{{ matrix.tox-env }}-{{ matrix.os }} - 8930203821.1 02 May 2024 08:54PM UTC 0
90.84
GitHub Action Run
2 run-{{ matrix.tox-env }}-opt-slow - 8930203821.2 02 May 2024 08:54PM UTC 0
90.07
GitHub Action Run
Source Files on build 8930203821
Detailed source file information is not available for this build.
  • Back to Repo
  • 4f2e633c on github
  • Prev Build on main (#8929138774)
  • Next Build on main (#8930622004)
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