summaryrefslogtreecommitdiff
path: root/numpy/oldnumeric
diff options
context:
space:
mode:
authorRobert Kern <robert.kern@gmail.com>2008-07-03 20:21:20 +0000
committerRobert Kern <robert.kern@gmail.com>2008-07-03 20:21:20 +0000
commit2f18f9d6834c1eeaf7a234f2810c8c1ba37c7abf (patch)
treec972009b347accebab93d0ba24942960ddda35d9 /numpy/oldnumeric
parent5873cfd7d0d8f280a3682ed80540cab2c1af65e4 (diff)
downloadnumpy-2f18f9d6834c1eeaf7a234f2810c8c1ba37c7abf.tar.gz
Correct the oldnumeric typecodes, update the tests to work on 32-bit machines, make sure these tests are installed with numpy so they can be run with numpy.test().
Diffstat (limited to 'numpy/oldnumeric')
-rw-r--r--numpy/oldnumeric/precision.py7
-rw-r--r--numpy/oldnumeric/setup.py4
-rw-r--r--numpy/oldnumeric/tests/test_oldnumeric.py30
3 files changed, 24 insertions, 17 deletions
diff --git a/numpy/oldnumeric/precision.py b/numpy/oldnumeric/precision.py
index 51dd77454..c095ceb19 100644
--- a/numpy/oldnumeric/precision.py
+++ b/numpy/oldnumeric/precision.py
@@ -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 @@ try:
__all__.extend(['UnsignedInt128', 'UInt128'])
except(PrecisionError):
pass
-UnsignedInteger = 'u'
-UInt = UnsignedInteger
+UInt = UnsignedInt = UnsignedInteger = 'u'
try:
Int0 = _lookup(_code_table, 'Integer', 0)
diff --git a/numpy/oldnumeric/setup.py b/numpy/oldnumeric/setup.py
index 82e8a6201..31b5ff3cc 100644
--- a/numpy/oldnumeric/setup.py
+++ b/numpy/oldnumeric/setup.py
@@ -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
diff --git a/numpy/oldnumeric/tests/test_oldnumeric.py b/numpy/oldnumeric/tests/test_oldnumeric.py
index 18c970235..24d709d2c 100644
--- a/numpy/oldnumeric/tests/test_oldnumeric.py
+++ b/numpy/oldnumeric/tests/test_oldnumeric.py
@@ -51,9 +51,13 @@ class test_oldtypes(unittest.TestCase):
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)
@@ -74,15 +78,17 @@ class test_oldtypes(unittest.TestCase):
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__":
- run_module_suite()
+ import nose
+ nose.main()