Changeset 5870
- Timestamp:
- Oct 28, 2008, 9:04:30 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/utilities/test_numerical_tools.py
r5615 r5870 4 4 import unittest 5 5 from Numeric import zeros, array, allclose 6 from Numeric import ArrayType, Float, Int, array, alltrue 7 6 8 from math import sqrt, pi 7 9 from anuga.config import epsilon … … 64 66 65 67 def test_ensure_numeric(self): 66 from Numeric import ArrayType, Float, Int, array67 68 68 A = [1,2,3,4] 69 69 B = ensure_numeric(A) … … 94 94 assert type(B) == ArrayType 95 95 assert B.typecode() == 'l' 96 assert A == B96 assert alltrue(A == B) 97 97 assert A is B #Same object 98 98 … … 101 101 assert type(B) == ArrayType 102 102 assert B.typecode() == 'd' 103 assert A == B103 assert alltrue(A == B) 104 104 assert A is not B #Not the same object 105 105 … … 109 109 #print A, B[0], len(B), type(B) 110 110 #print B.shape 111 assert A == B111 assert alltrue(A == B) 112 112 113 113 B = ensure_numeric(A, Int) 114 114 #print A, B 115 115 #print B.shape 116 assert A == B116 assert alltrue(A == B) 117 117 118 118 # Error situation
Note: See TracChangeset
for help on using the changeset viewer.