Changeset 5870


Ignore:
Timestamp:
Oct 28, 2008, 9:04:30 AM (15 years ago)
Author:
ole
Message:

Made use of alltrue which was missing before.

File:
1 edited

Legend:

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

    r5615 r5870  
    44import unittest
    55from Numeric import zeros, array, allclose
     6from Numeric import ArrayType, Float, Int, array, alltrue
     7
    68from math import sqrt, pi
    79from anuga.config import epsilon
     
    6466       
    6567    def test_ensure_numeric(self):
    66         from Numeric import ArrayType, Float, Int, array
    67 
    6868        A = [1,2,3,4]
    6969        B = ensure_numeric(A)
     
    9494        assert type(B) == ArrayType
    9595        assert B.typecode() == 'l'       
    96         assert A == B   
     96        assert alltrue(A == B)   
    9797        assert A is B   #Same object
    9898
     
    101101        assert type(B) == ArrayType
    102102        assert B.typecode() == 'd'       
    103         assert A == B   
     103        assert alltrue(A == B)   
    104104        assert A is not B   #Not the same object
    105105
     
    109109        #print A, B[0], len(B), type(B)
    110110        #print B.shape
    111         assert A == B
     111        assert alltrue(A == B)
    112112
    113113        B = ensure_numeric(A, Int)       
    114114        #print A, B
    115115        #print B.shape
    116         assert A == B
     116        assert alltrue(A == B)
    117117
    118118        # Error situation
Note: See TracChangeset for help on using the changeset viewer.