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

Ouranosinc / xclim / 8930203821 / 2
92%
main: 92%

Build:
DEFAULT BRANCH: main
Ran 02 May 2024 08:54PM 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

02 May 2024 08:42PM UTC coverage: 90.075% (-0.1%) from 90.171%
8930203821.2

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)

8794 of 9763 relevant lines covered (90.07%)

1.8 hits per line

Source Files on job run-{{ matrix.tox-env }}-opt-slow - 8930203821.2
  • Tree
  • List 0
  • Changed 4
  • Source Changed 0
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 8930203821
  • 4f2e633c on github
  • Prev Job for on main (#8929138774.1)
  • Next Job for on main (#8930622004.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