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

Introduced maximal_inundation_elevation (runup) for sww files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.