Skip to content

a possible MA regression #7509

Closed
Closed
@ev-br

Description

@ev-br

scipy tests started failing today with numpy from travis-dev-wheels.
The failure is in mstats: https://travis-ci.org/scipy/scipy/builds/120882377

The failing test does this:

In [1]: from scipy.stats import mstats

In [2]: %paste
        x = [1, 3, 5, 7, 9]
        y = [2, 4, 6, 8, 10]
## -- End pasted text --

In [3]: mstats.kruskal(x, y)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-3-5edb46bc91da> in <module>()
----> 1 mstats.kruskal(x, y)

/home/br/virtualenvs/np/local/lib/python2.7/site-packages/scipy/stats/mstats_basic.pyc in kruskal(*args)
   1047     ngrp = ranks.count(-1)
   1048     ntot = ranks.count()
-> 1049     H = 12./(ntot*(ntot+1)) * (sumrk**2/ngrp).sum() - 3*(ntot+1)
   1050     # Tie correction
   1051     ties = count_tied_groups(ranks)

/home/br/repos/numpy/build/testenv/lib/python2.7/site-packages/numpy/ma/core.pyc in __truediv__(self, other)
   3983         if self._delegate_binop(other):
   3984             return NotImplemented
-> 3985         return true_divide(self, other)
   3986 
   3987     def __rtruediv__(self, other):

/home/br/repos/numpy/build/testenv/lib/python2.7/site-packages/numpy/ma/core.pyc in __call__(self, a, b, *args, **kwargs)
   1126         # Get the result
   1127         with np.errstate(divide='ignore', invalid='ignore'):
-> 1128             result = self.f(da, db, *args, **kwargs)
   1129         # Get the mask as a combination of the source masks and invalid
   1130         m = ~umath.isfinite(result)

ValueError: operands could not be broadcast together with shapes (2,) (2,5) 

and bisecting indicates

$ git bisect bad
36f76ea2e6e91062df12d3a46ccaed7822bc82f2 is the first bad commit
commit 36f76ea2e6e91062df12d3a46ccaed7822bc82f2
Author: Allan Haldane <allan.haldane@gmail.com>
Date:   Sun Feb 14 02:49:19 2016 -0500

    ENH: add extra kwargs and update doc of many MA methods

    Updated any, all, sum, prod, cumsum, cumprod, min, max, argmin, argmax,
    mean, var

:040000 040000 e41cfd58bb4bbabc11471a0bd443b24be91b45d0 7f99716492632508bc4d664d424c7cf22d6cd5cb M  numpy

which is, it seems, gh-5706?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions