- Timestamp:
- Nov 12, 2008, 12:14:33 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source_numpy_conversion/anuga/utilities/numerical_tools.py
r5902 r5948 7 7 from warnings import warn 8 8 9 ##from numpy import ndarray, array, sum, inner, ravel, sqrt, searchsorted, sort, concatenate, float, arange10 9 import numpy 10 11 from anuga.config import Float 11 12 12 13 # Getting an infinite number to use when using Numeric … … 79 80 v2 = [1.0, 0.0] # Unit vector along the x-axis 80 81 81 v1 = ensure_numeric(v1, numpy.float)82 v2 = ensure_numeric(v2, numpy.float)82 v1 = ensure_numeric(v1, Float) 83 v2 = ensure_numeric(v2, Float) 83 84 84 85 # Normalise … … 130 131 """ 131 132 132 return numpy.array([-v[1], v[0]], numpy.float)133 return numpy.array([-v[1], v[0]], Float) 133 134 134 135 … … 252 253 253 254 if typecode is None: 254 ##NumPy if isinstance(A, ArrayType):255 255 if type(A) == numpy.ndarray: 256 256 return A … … 258 258 return numpy.array(A) 259 259 else: 260 ##NumPy if isinstance(A, ArrayType):261 260 if type(A) == numpy.ndarray: 262 ##NumPy if A.typecode == typecode:263 261 if A.dtype == typecode: 264 262 return numpy.array(A) #FIXME: Shouldn't this just return A? … … 267 265 else: 268 266 import types ## 269 from numpy import str ##270 267 if isinstance(A, types.StringType): ## 271 return numpy.array(A, dtype=int) 268 return numpy.array(A, dtype=int) ## 272 269 return numpy.array(A, typecode) 273 270
Note: See TracChangeset
for help on using the changeset viewer.