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

pyro-ppl / numpyro / 36754303847
93%

Build:
DEFAULT BRANCH: master
Ran 30 Sep 2026 06:12PM UTC
Jobs 3
Files 87
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

30 Sep 2026 05:50PM UTC coverage: 92.71% (+0.002%) from 92.708%
36754303847

push

github

web-flow
fix(distributions): type DistributionMeta.__call__ to return the instance type (#2293)

* fix(distributions): type distribution sampling as jax.Array

`DistributionMeta.__call__` was annotated `-> Any`, so every constructed distribution (`dist.Normal(0.0, 1.0)`) was inferred as `Any` by ty and the `-> Array` annotations on concrete `sample` methods never reached callers. Return the constructed instance type via a bound `TypeVar` instead.

With that in place, tighten the sampling surface in `distribution.py` (`sample`, `rsample`, `sample_with_intermediates`, `__call__`) from `ArrayLike` to `Array`, and fix the latent ty errors that `Any` had been masking.

`Delta.sample` returned the raw `v` (Python scalar or numpy array) when `sample_shape` was empty; it now always returns a `jax.Array`, matching every other distribution. The `Delta` carve-out in `test_dist_shape` is removed accordingly.

* fix(distributions): keep ArrayLike on base-class sampling per gh-2206

The base and wrapper distributions (Distribution, ExpandedDistribution, Independent, MaskedDistribution, TransformedDistribution, Delta) intentionally keep `ArrayLike` on `sample`/`rsample`/`sample_with_intermediates`/`__call__`, and `Delta.sample` returns the stored value untouched, so that numpy-backed or string-valued custom distributions pass through handlers (see gh-2206 and `test_handlers_with_string_valued_distribution`). Restore that surface and the `Delta` carve-out in `test_dist_shape`.

The `DistributionMeta.__call__` return type is what lets the concrete `-> Array` annotations on each distribution's `sample` reach callers; that change and the ty fixes it surfaced remain.

* refactor(distributions): drop comment on DistributionMeta.__call__

13 of 15 new or added lines in 5 files covered. (86.67%)

1 existing line in 1 file now uncovered.

15643 of 16873 relevant lines covered (92.71%)

1.7 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
98.51
0.0% numpyro/distributions/continuous.py

Coverage Regressions

Lines Coverage ∆ File
1
98.51
0.0% numpyro/distributions/continuous.py
Jobs
ID Job ID Ran Files Coverage
1 test-inference - 36754303847.1 30 Sep 2026 06:52PM UTC 87
70.86
GitHub Action Run
2 examples - 36754303847.2 30 Sep 2026 06:12PM UTC 87
29.06
GitHub Action Run
3 test-modeling - 36754303847.3 30 Sep 2026 07:13PM UTC 87
70.09
GitHub Action Run
Source Files on build 36754303847
  • Tree
  • List 87
  • Changed 5
  • Source Changed 5
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #36754303847
  • b5399b9c on github
  • Prev Build on master (#36654490556)
  • Next Build on master (#36882643159)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc