Ignore:
Timestamp:
Nov 12, 2008, 12:14:33 PM (15 years ago)
Author:
rwilson
Message:

More NumPy? changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source_numpy_conversion/anuga/utilities/numerical_tools.py

    r5902 r5948  
    77from warnings import warn
    88
    9 ##from numpy import ndarray, array, sum, inner, ravel, sqrt, searchsorted, sort, concatenate, float, arange
    109import numpy
     10
     11from anuga.config import Float
    1112
    1213# Getting an infinite number to use when using Numeric
     
    7980        v2 = [1.0, 0.0] # Unit vector along the x-axis
    8081       
    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)   
    8384   
    8485    # Normalise
     
    130131    """
    131132   
    132     return numpy.array([-v[1], v[0]], numpy.float)
     133    return numpy.array([-v[1], v[0]], Float)
    133134
    134135   
     
    252253
    253254    if typecode is None:
    254 ##NumPy        if isinstance(A, ArrayType):
    255255        if type(A) == numpy.ndarray:
    256256            return A
     
    258258            return numpy.array(A)
    259259    else:
    260 ##NumPy        if isinstance(A, ArrayType):
    261260        if type(A) == numpy.ndarray:
    262 ##NumPy            if A.typecode == typecode:
    263261            if A.dtype == typecode:
    264262                return numpy.array(A)  #FIXME: Shouldn't this just return A?
     
    267265        else:
    268266            import types                            ##
    269             from numpy import str                   ##
    270267            if isinstance(A, types.StringType):     ##
    271                 return numpy.array(A, dtype=int)          ##
     268                return numpy.array(A, dtype=int)    ##
    272269            return numpy.array(A, typecode)
    273270
Note: See TracChangeset for help on using the changeset viewer.