- Timestamp:
- Jun 20, 2007, 6:34:00 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/utilities/test_numerical_tools.py
r3849 r4551 77 77 def test_ensure_numeric(self): 78 78 from numerical_tools import ensure_numeric 79 from Numeric import ArrayType, Float, array79 from Numeric import ArrayType, Float, Int, array 80 80 81 81 A = [1,2,3,4] … … 122 122 assert A is not B #Not the same object 123 123 124 # Check scalars 125 A = 1 126 B = ensure_numeric(A, Float) 127 #print A, B[0], len(B), type(B) 128 #print B.shape 129 assert A == B 130 131 B = ensure_numeric(A, Int) 132 #print A, B 133 #print B.shape 134 assert A == B 135 136 # Error situation 137 138 B = ensure_numeric('hello', Int) 139 assert allclose(B, [104, 101, 108, 108, 111]) 124 140 125 141 def test_gradient(self):
Note: See TracChangeset
for help on using the changeset viewer.