diff options
Diffstat (limited to 'numpy/lib')
-rw-r--r-- | numpy/lib/getlimits.py | 4 | ||||
-rw-r--r-- | numpy/lib/tests/test_getlimits.py | 10 | ||||
-rw-r--r-- | numpy/lib/tests/test_polynomial.py | 8 |
3 files changed, 10 insertions, 12 deletions
diff --git a/numpy/lib/getlimits.py b/numpy/lib/getlimits.py index 00c3ea846..89b40203f 100644 --- a/numpy/lib/getlimits.py +++ b/numpy/lib/getlimits.py @@ -7,7 +7,7 @@ from machar import MachAr import numpy.core.numeric as numeric import numpy.core.numerictypes as ntypes from numpy.core.numeric import array -import numpy as N +import numpy as np def _frz(a): """fix rank-0 --> rank-1""" @@ -128,7 +128,7 @@ class iinfo: _max_vals = {} def __init__(self, type): - self.dtype = N.dtype(type) + self.dtype = np.dtype(type) self.kind = self.dtype.kind self.bits = self.dtype.itemsize * 8 self.key = "%s%d" % (self.kind, self.bits) diff --git a/numpy/lib/tests/test_getlimits.py b/numpy/lib/tests/test_getlimits.py index 3c53f3322..a85228689 100644 --- a/numpy/lib/tests/test_getlimits.py +++ b/numpy/lib/tests/test_getlimits.py @@ -2,12 +2,10 @@ """ from numpy.testing import * -set_package_path() import numpy.lib;reload(numpy.lib) from numpy.lib.getlimits import finfo, iinfo from numpy import single,double,longdouble -import numpy as N -restore_path() +import numpy as np ################################################## @@ -39,15 +37,15 @@ class TestIinfo(NumpyTestCase): def check_basic(self): dts = zip(['i1', 'i2', 'i4', 'i8', 'u1', 'u2', 'u4', 'u8'], - [N.int8, N.int16, N.int32, N.int64, - N.uint8, N.uint16, N.uint32, N.uint64]) + [np.int8, np.int16, np.int32, np.int64, + np.uint8, np.uint16, np.uint32, np.uint64]) for dt1, dt2 in dts: assert_equal(iinfo(dt1).min, iinfo(dt2).min) assert_equal(iinfo(dt1).max, iinfo(dt2).max) self.assertRaises(ValueError, iinfo, 'f4') def check_unsigned_max(self): - types = N.sctypes['uint'] + types = np.sctypes['uint'] for T in types: assert_equal(iinfo(T).max, T(-1)) diff --git a/numpy/lib/tests/test_polynomial.py b/numpy/lib/tests/test_polynomial.py index c9a230775..17d22e10e 100644 --- a/numpy/lib/tests/test_polynomial.py +++ b/numpy/lib/tests/test_polynomial.py @@ -74,22 +74,22 @@ poly1d([ 2.]) """ from numpy.testing import * -import numpy as N +import numpy as np class TestDocs(NumpyTestCase): def check_doctests(self): return self.rundocs() def check_roots(self): - assert_array_equal(N.roots([1,0,0]), [0,0]) + assert_array_equal(np.roots([1,0,0]), [0,0]) def check_str_leading_zeros(self): - p = N.poly1d([4,3,2,1]) + p = np.poly1d([4,3,2,1]) p[3] = 0 assert_equal(str(p), " 2\n" "3 x + 2 x + 1") - p = N.poly1d([1,2]) + p = np.poly1d([1,2]) p[0] = 0 p[1] = 0 assert_equal(str(p), " \n0") |