Skip to content

Pull request #445, rebased #2840

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

Closed
wants to merge 3 commits into from
Closed

Conversation

certik
Copy link
Contributor

@certik certik commented Dec 16, 2012

I just rebased #445 on top of the latest master and resolved the conflicts.

87 added 3 commits December 16, 2012 14:06
This fixes an issue with ndindex shape tuple recognition, and an issue
in the nditer where scalar input did not produce an empty index tuple.
To be able to fix nditer, an extra flag has been added: NPY_ITFLAG_SCALAR
and a new function NpyIter_IsScalar has been added to the nditer API.
Also a few tests have been added to make sure the ndindex behaves as
intended.
@certik
Copy link
Contributor Author

certik commented Dec 16, 2012

All tests fail with the error:

======================================================================
ERROR: test_index_tricks.test_ndindex
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/virtualenv/python2.6/lib/python2.6/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/travis/virtualenv/python2.6/lib/python2.6/site-packages/numpy/lib/tests/test_index_tricks.py", line 248, in test_ndindex
    z = list(np.ndindex(()))
  File "/home/travis/virtualenv/python2.6/lib/python2.6/site-packages/numpy/lib/index_tricks.py", line 539, in __init__
    x = as_strided(_nx.zeros(1), shape=shape, strides=_nx.zeros_like(shape))
  File "/home/travis/virtualenv/python2.6/lib/python2.6/site-packages/numpy/lib/stride_tricks.py", line 28, in as_strided
    return np.asarray(DummyArray(interface, base=x))
  File "/home/travis/virtualenv/python2.6/lib/python2.6/site-packages/numpy/core/numeric.py", line 324, in asarray
    return array(a, dtype, copy=False, order=order)
ValueError: __array_interface__ shape must be at least size 1

----------------------------------------------------------------------

So this needs to be fixed.

@njsmith
Copy link
Member

njsmith commented Dec 16, 2012

This looks like a straight-up bug in
54b4dc7, which introduced that error
message. A shape of () is totally valid.

On Sun, Dec 16, 2012 at 10:13 PM, Ondřej Čertík notifications@github.comwrote:

All tests fail with the error:

ERROR: test_index_tricks.test_ndindex

Traceback (most recent call last):
File "/home/travis/virtualenv/python2.6/lib/python2.6/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/travis/virtualenv/python2.6/lib/python2.6/site-packages/numpy/lib/tests/test_index_tricks.py", line 248, in test_ndindex
z = list(np.ndindex(()))
File "/home/travis/virtualenv/python2.6/lib/python2.6/site-packages/numpy/lib/index_tricks.py", line 539, in init
x = as_strided(_nx.zeros(1), shape=shape, strides=_nx.zeros_like(shape))
File "/home/travis/virtualenv/python2.6/lib/python2.6/site-packages/numpy/lib/stride_tricks.py", line 28, in as_strided
return np.asarray(DummyArray(interface, base=x))
File "/home/travis/virtualenv/python2.6/lib/python2.6/site-packages/numpy/core/numeric.py", line 324, in asarray
return array(a, dtype, copy=False, order=order)
ValueError: array_interface shape must be at least size 1


So this needs to be fixed.


Reply to this email directly or view it on GitHubhttps://github.com//pull/2840#issuecomment-11423752.

@certik certik mentioned this pull request Dec 16, 2012
@certik
Copy link
Contributor Author

certik commented Dec 21, 2012

@87, would you have time to fix that?

@charris
Copy link
Member

charris commented Jan 6, 2013

@certik Already committed? The removal of NpyIter_IsScalar is a done deal.

@certik
Copy link
Contributor Author

certik commented Jan 7, 2013

Ok, cool. I am closing this pull request.

@certik certik closed this Jan 7, 2013
@charris charris reopened this Jan 7, 2013
@charris
Copy link
Member

charris commented Jan 7, 2013

My bad, first NpyIter_IsScalar was added, then it was removed again. So it is still gone ;)

@charris
Copy link
Member

charris commented Mar 2, 2013

@seberg Does your work cover this? If so, just comment and close.

@seberg
Copy link
Member

seberg commented Mar 2, 2013

Yes, this should be superceded by gh-3104, so closing.

@seberg seberg closed this Mar 2, 2013
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.

5 participants