[Numpy-discussion] numpy test and "true division"

Sebastian Haase seb.haase@gmail....
Fri Jun 12 03:40:05 CDT 2009


Hi all,

first off - I'm happy that I finally figured out how to run the test
suite, and I get only one failure (Debian 64-bit, Numpy 1.3.0, "FAIL:
Ticket #950")
Before though, I got:    Ran 2031 tests in 5.272s
FAILED (KNOWNFAIL=1, SKIP=11, errors=3, failures=8)

Then I realized that I changed my python to always start up using
"-Qnew" - i.e. default to true division (1/2 = .5 and not 1/2=0).

So, would it be possible to change those 8-12 test to use '//':

using python -Qwarn -i
I get:
Python 2.5.2 (r252:60911, Jan  4 2009, 21:59:32)
/numpy/core/numerictypes.py:245: DeprecationWarning: classic int division
  bytes = bits / 8
/numpy/core/numerictypes.py:285: DeprecationWarning: classic int division
  na_name = '%s%d' % (english_capitalize(base), bit/2)
/numpy/core/numerictypes.py:315: DeprecationWarning: classic int division
  charname = 'i%d' % (bits/8,)
/numpy/core/numerictypes.py:316: DeprecationWarning: classic int division
  ucharname = 'u%d' % (bits/8,)
/numpy/core/numerictypes.py:557: DeprecationWarning: classic int division
  nbytes[obj] = val[2] / 8
>>> import sys;sys.displayhook = sys.__displayhook__
>>> N.test()
Running unit tests for numpy
NumPy version 1.3.0
NumPy is installed in /home/shaase/Priithon_25_lin64/numpy
Python version 2.5.2 (r252:60911, Jan  4 2009, 21:59:32) [GCC 4.3.2]
nose version 0.10.4
/numpy/f2py/auxfuncs.py:568: DeprecationWarning: classic int division
/numpy/fft/helper.py:38: DeprecationWarning: classic int division
  p2 = (n+1)/2
/numpy/fft/helper.py:67: DeprecationWarning: classic int division
  p2 = n-(n+1)/2
/numpy/lib/tests/test_arraysetops.py:138: DeprecationWarning: classic
int division
  a = np.fix( nItem / 10 * np.random.random( nItem ) )
/numpy/lib/tests/test_arraysetops.py:139: DeprecationWarning: classic
int division
  b = np.fix( nItem / 10 * np.random.random( nItem ) )
/numpy/lib/function_base.py:613: DeprecationWarning: classic int division
  scl = avg.dtype.type(a.size/avg.size)
/numpy/lib/shape_base.py:1079: DeprecationWarning: classic int division
  n /= max(dim_in,1)
/numpy/linalg/linalg.py:830: DeprecationWarning: classic int division
  for i in range(len(ind)/2):
FAIL: Ticket #950
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/shaase/Priithon_25_lin64/numpy/core/tests/test_regression.py",
line 1248, in test_blasdot_uninitialized_memory
    assert np.all(z == 0)
AssertionError
--------------------------------------

Cheers,
Sebastian Haase


More information about the Numpy-discussion mailing list