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

hgrecco / pint / 1737 / 10
91%
master: 91%

Build:
DEFAULT BRANCH: master
Ran 23 Apr 2020 09:38PM UTC
Files 18
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

23 Apr 2020 09:22PM UTC coverage: 87.543% (+0.05%) from 87.494%
PKGS="python=3.8 numpy=1.17 matplotlib"

push

travis-ci

web-flow
Merge #1087

1087: Implement prod r=hgrecco a=keewis

This implements `numpy.prod`. Support for passing both `axis` and `where` is not quite there, yet, because I couldn't figure out how to broadcast `where` to match the shape of the input array:
```python
if axis is not None and where is not None:
    # broadcast where to match the shape of a:
    # ↓ this is not reliable and does not work well if a contains a dask.array
    where_ = np.broadcast_to(where, a.shape)

    exponents = np.sum(where_, axis=axis)
    exponent = np.max(exponents)
    if not all((exponents == exponent) | (exponents == 0)):
        # try to convert to dimensionless
        ...

result = np.prod(a._magnitude, *args, **kwargs)

if axis is not None and where is not None:
    units = a._units ** exponent
elif axis is not None:
    ...
else:
    ...
```

cc @jthielen

- [x] Closes #867
- [x] Executed ``black -t py36 . && isort -rc . && flake8`` with no errors
- [x] The change is fully covered by automated unit tests
- [ ] Documented in docs/ as appropriate
- [ ] Added an entry to the CHANGES file


Co-authored-by: Keewis <keewis@posteo.de>

3584 of 4094 relevant lines covered (87.54%)

0.88 hits per line

Source Files on job 1737.10 (PKGS="python=3.8 numpy=1.17 matplotlib")
  • Tree
  • List 0
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 1616
  • Travis Job 1737.10
  • 5189aa01 on github
  • Prev Job for PKGS="python=3.8 numpy=1.17 matplotlib" on master (#1733.10)
  • Next Job for PKGS="python=3.8 numpy=1.17 matplotlib" on master (#1739.10)
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