[Numpy-svn] r5417 - in branches/1.1.x/numpy/oldnumeric: . tests

numpy-svn at scipy.org numpy-svn at scipy.org
Tue Jul 15 04:07:56 EDT 2008


Author: rkern
Date: 2008-07-15 03:07:53 -0500 (Tue, 15 Jul 2008)
New Revision: 5417

Modified:
   branches/1.1.x/numpy/oldnumeric/precision.py
   branches/1.1.x/numpy/oldnumeric/setup.py
   branches/1.1.x/numpy/oldnumeric/tests/test_oldnumeric.py
Log:
Backport r5349.

Modified: branches/1.1.x/numpy/oldnumeric/precision.py
===================================================================
--- branches/1.1.x/numpy/oldnumeric/precision.py	2008-07-15 08:03:28 UTC (rev 5416)
+++ branches/1.1.x/numpy/oldnumeric/precision.py	2008-07-15 08:07:53 UTC (rev 5417)
@@ -5,12 +5,12 @@
 
 __all__ = ['Character', 'Complex', 'Float',
            'PrecisionError', 'PyObject', 'Int', 'UInt',
-           'UnsignedInteger', 'string', 'typecodes', 'zeros']
+           'UnsignedInt', 'UnsignedInteger', 'string', 'typecodes', 'zeros']
 
 from functions import zeros
 import string   # for backwards compatibility
 
-typecodes = {'Character':'c', 'Integer':'bhil', 'UnsignedInteger':'BHI', 'Float':'fd', 'Complex':'FD'}
+typecodes = {'Character':'c', 'Integer':'bhil', 'UnsignedInteger':'BHIL', 'Float':'fd', 'Complex':'FD'}
 
 def _get_precisions(typecodes):
     lst = []
@@ -67,8 +67,7 @@
     __all__.extend(['UnsignedInt128', 'UInt128'])
 except(PrecisionError):
     pass
-UnsignedInteger = 'u'
-UInt = UnsignedInteger
+UInt = UnsignedInt = UnsignedInteger = 'u'
 
 try:
     Int0 = _lookup(_code_table, 'Integer', 0)

Modified: branches/1.1.x/numpy/oldnumeric/setup.py
===================================================================
--- branches/1.1.x/numpy/oldnumeric/setup.py	2008-07-15 08:03:28 UTC (rev 5416)
+++ branches/1.1.x/numpy/oldnumeric/setup.py	2008-07-15 08:07:53 UTC (rev 5417)
@@ -1,7 +1,9 @@
 
 def configuration(parent_package='',top_path=None):
     from numpy.distutils.misc_util import Configuration
-    return Configuration('oldnumeric',parent_package,top_path)
+    config = Configuration('oldnumeric',parent_package,top_path)
+    config.add_data_dir('tests')
+    return config
 
 if __name__ == '__main__':
     from numpy.distutils.core import setup

Modified: branches/1.1.x/numpy/oldnumeric/tests/test_oldnumeric.py
===================================================================
--- branches/1.1.x/numpy/oldnumeric/tests/test_oldnumeric.py	2008-07-15 08:03:28 UTC (rev 5416)
+++ branches/1.1.x/numpy/oldnumeric/tests/test_oldnumeric.py	2008-07-15 08:07:53 UTC (rev 5417)
@@ -5,7 +5,7 @@
 from numpy.core.numeric import float32, float64, complex64, complex128, int8, \
         int16, int32, int64, uint, uint8, uint16, uint32, uint64
 
-class test_oldtypes(NumPyTestCase):
+class test_oldtypes(NumpyTestCase):
     def check_oldtypes(self, level=1):
         a1 = array([0,1,0], Float)
         a2 = array([0,1,0], float)
@@ -49,9 +49,13 @@
         a1 = array([0,1,0], Int32)
         a2 = array([0,1,0], int32)
         assert_array_equal(a1, a2)
-        a1 = array([0,1,0], Int64)
-        a2 = array([0,1,0], int64)
-        assert_array_equal(a1, a2)
+        try:
+            a1 = array([0,1,0], Int64)
+            a2 = array([0,1,0], int64)
+            assert_array_equal(a1, a2)
+        except NameError:
+            # Not all systems have 64-bit integers.
+            pass
         a1 = array([0,1,0], UnsignedInt)
         a2 = array([0,1,0], UnsignedInteger)
         a3 = array([0,1,0], uint)
@@ -72,15 +76,15 @@
         a3 = array([0,1,0], uint32)
         assert_array_equal(a1, a3)
         assert_array_equal(a2, a3)
-        a1 = array([0,1,0], UInt64)
-        a2 = array([0,1,0], UnsignedInt64)
-        a3 = array([0,1,0], uint64)
-        assert_array_equal(a1, a3)
-        assert_array_equal(a2, a3)
-        a1 = array([0,1,0], Bool)
-        a2 = array([0,1,0], bool)
-        assert_array_equal(a1, a2)
+        try:
+            a1 = array([0,1,0], UInt64)
+            a2 = array([0,1,0], UnsignedInt64)
+            a3 = array([0,1,0], uint64)
+            assert_array_equal(a1, a3)
+            assert_array_equal(a2, a3)
+        except NameError:
+            # Not all systems have 64-bit integers.
+            pass
 
-
 if __name__ == "__main__":
-    NumPyTest().run()
+    NumpyTest().run()




More information about the Numpy-svn mailing list