Skip to content
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

FAIL: Test median. with numpy-1.10 #105

Closed
jlec opened this issue Oct 20, 2015 · 11 comments
Closed

FAIL: Test median. with numpy-1.10 #105

jlec opened this issue Oct 20, 2015 · 11 comments

Comments

@jlec
Copy link

jlec commented Oct 20, 2015

======================================================================
FAIL: Test median.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.4/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/var/tmp/portage/dev-python/bottleneck-1.0.0/work/Bottleneck-1.0.0-python3_4/lib/bottleneck/tests/reduce_test.py", line 95, in unit_maker
    assert_array_equal(actual, desired, err_msg)
  File "/usr/lib64/python3.4/site-packages/numpy/testing/utils.py", line 782, in assert_array_equal
    verbose=verbose, header='Arrays are not equal')
  File "/usr/lib64/python3.4/site-packages/numpy/testing/utils.py", line 708, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Arrays are not equal

func median | input a0 (float64) | shape (0,) | axis -1

Input array:
[]

(mismatch 100.0%)
 x: array(nan)
 y: array('Crashed', 
      dtype='<U7')

----------------------------------------------------------------------
Ran 79 tests in 129.634s

FAILED (failures=1)
Running unit tests for bottleneck
NumPy version 1.10.1
NumPy relaxed strides checking option: True
NumPy is installed in /usr/lib64/python3.4/site-packages/numpy
Python version 3.4.3 (default, Aug 21 2015, 10:51:23) [GCC 4.9.3]
nose version 1.3.7

I haven't tested it with numpy-1.9 again but I really suspect numpy here.

@jlec
Copy link
Author

jlec commented Oct 20, 2015

Same problem with numpy-1.9.3

@kwgoodman
Copy link
Collaborator

I installed numpy 1.10.1 and see the same unit test failure. I don't see the unit test failure with numpy 1.9.1. Can you double-check that you are seeing the unit test failure with numpy 1.9.1?

Yeah, you're right. We'll have to ask numpy about this:

In [1]: a = np.zeros((0,))
In [2]: bn.median(a)
Out[2]: nan
In [3]: np.median(a)
<snip>
IndexError: index -1 is out of bounds for axis 0 with size 0

At the very least, the numpy error message is wrong.

@kwgoodman
Copy link
Collaborator

Bug has already been caught in numpy: numpy/numpy#6462

Looks like it will be fixed in numpy 1.10.2.

@jlec
Copy link
Author

jlec commented Oct 20, 2015

Still see it with numpy-1.9.1

@kwgoodman
Copy link
Collaborator

Can you post the output of the bottleneck unit tests with numpy 1.9.1 like you did with numpy 1.10.1?

@jlec
Copy link
Author

jlec commented Oct 20, 2015

======================================================================
ERROR: Test rankdata.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.4/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/var/tmp/portage/dev-python/bottleneck-1.0.0/work/Bottleneck-1.0.0-python3_4/lib/bottleneck/tests/list_input_test.py", line 38, in unit_maker
    desired = func0(*argsi)
  File "/var/tmp/portage/dev-python/bottleneck-1.0.0/work/Bottleneck-1.0.0-python3_4/lib/bottleneck/slow/nonreduce_axis.py", line 14, in rankdata
    from scipy.stats import rankdata as imported_rankdata
  File "/usr/lib64/python3.4/site-packages/scipy/stats/__init__.py", line 321, in <module>
    from .stats import *
  File "/usr/lib64/python3.4/site-packages/scipy/stats/stats.py", line 180, in <module>
    import scipy.special as special
  File "/usr/lib64/python3.4/site-packages/scipy/special/__init__.py", line 601, in <module>
    from ._ufuncs import *
  File "__init__.pxd", line 155, in init scipy.special._ufuncs (scipy/special/_ufuncs.c:28225)
ValueError: numpy.dtype has the wrong size, try recompiling

======================================================================
FAIL: Test rankdata.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.4/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/var/tmp/portage/dev-python/bottleneck-1.0.0/work/Bottleneck-1.0.0-python3_4/lib/bottleneck/tests/reduce_test.py", line 95, in unit_maker
    assert_array_equal(actual, desired, err_msg)
  File "/usr/lib64/python3.4/site-packages/numpy/testing/utils.py", line 739, in assert_array_equal
    verbose=verbose, header='Arrays are not equal')
  File "/usr/lib64/python3.4/site-packages/numpy/testing/utils.py", line 665, in assert_array_compare
    raise AssertionError(msg)
AssertionError:
Arrays are not equal

func rankdata | input a0 (float64) | shape (0,) | axis -1

Input array:
[]

(mismatch 100.0%)
 x: array([], dtype=float64)
 y: array('Crashed',
      dtype='<U7')

----------------------------------------------------------------------
Ran 79 tests in 91.001s

FAILED (errors=1, failures=1)
Running unit tests for bottleneck
NumPy version 1.9.1
NumPy is installed in /usr/lib64/python3.4/site-packages/numpy
Python version 3.4.3 (default, Aug 21 2015, 10:51:23) [GCC 4.9.3]
nose version 1.3.7

@jlec
Copy link
Author

jlec commented Oct 20, 2015

Looking at the error message it seems it is a scipy problem when not recompiled after downgrade.

@kwgoodman
Copy link
Collaborator

Oh, OK, that is probably it. Also it is for a different function, rankdata, instead of median.

Thanks for reporting. I hadn't tried numpy 1.10.1 until you reported the problem.

@jlec
Copy link
Author

jlec commented Oct 20, 2015

Bug has already been caught in numpy: numpy/numpy#6462

Backporting this commit makes this bug go away.

@kwgoodman
Copy link
Collaborator

Good check. OK, we'll sit tight until np 1.10.2 is released.

@kwgoodman
Copy link
Collaborator

No unit test failures with np 1.10.4. I'm closing.

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

No branches or pull requests

2 participants