Ignore:
Timestamp:
Jun 20, 2007, 6:34:00 PM (18 years ago)
Author:
ole
Message:

Introduced maximal_inundation_elevation (runup) for sww files

Location:
anuga_core/source/anuga/utilities
Files:
2 edited

Legend:

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

    r4341 r4551  
    246246                     If not, an attempt is made to convert it to a Numeric
    247247                     array
     248        A: Scalar.   Return 0-dimensional array of length 1, containing that value
     249        A: String.   Array of ASCII values
    248250        typecode: Numeric type. If specified, use this in the conversion.
    249251                                If not, let Numeric decide
  • anuga_core/source/anuga/utilities/test_numerical_tools.py

    r3849 r4551  
    7777    def test_ensure_numeric(self):
    7878        from numerical_tools import ensure_numeric
    79         from Numeric import ArrayType, Float, array
     79        from Numeric import ArrayType, Float, Int, array
    8080
    8181        A = [1,2,3,4]
     
    122122        assert A is not B   #Not the same object
    123123
     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])
    124140
    125141    def test_gradient(self):
Note: See TracChangeset for help on using the changeset viewer.