Thanks to visit codestin.com
Credit goes to github.com

Skip to content

BUG: handle length-0 axes correctly in ufunc.reduce without identity #323

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 6, 2012

Conversation

njsmith
Copy link
Member

@njsmith njsmith commented Jun 27, 2012

In numpy 1.6, reduction operations with no identity
(e.g. numpy.maximum) gave an error iff they were asked to reduce a
0-element dimension. This regressed during the 1.7 development cycle,
so that they started giving an error if any dimension had 0
elements, even ones that were not reduced over. Fixes bug #2078.

In numpy 1.6, reduction operations with no identity
(e.g. numpy.maximum) gave an error iff they were asked to reduce a
0-element dimension. This regressed during the 1.7 development cycle,
so that they started giving an error if *any* dimension had 0
elements, even ones that were not reduced over. Fixes bug numpy#2078.
@travisbot
Copy link

This pull request fails (merged 15738e1 into e15d0bd).

@njsmith
Copy link
Member Author

njsmith commented Jun 27, 2012

WTF? The one failure reported by Travis-CI is with Python 2.5, it's a test unrelated to this change, and I can't reproduce it here.

The failing test is:

  a = np.arange(5)
  a[:3] = a[2:]
  assert_equal(a, [2, 3, 4, 3, 4])

and what we're getting for a is [4, 3, 4, 3, 4], which is what you'd expect if the assignments were performed in backwards order (a[2] = a[4], a[1] = a[3], a[0] = a[2]).

I suspect that what this is saying is that numpy is in fact buggy in how it handles these assignments, but that this test has mostly been accidentally passing by chance.

@njsmith
Copy link
Member Author

njsmith commented Jun 27, 2012

Re: the test failure: http://mail.scipy.org/pipermail/numpy-discussion/2012-June/063010.html

Anyway, I think this PR itself is fine.

@stefanv
Copy link
Contributor

stefanv commented Jul 1, 2012

Looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants