Index: /anuga_core/source_numpy_conversion/anuga/utilities/cg_solve.py
===================================================================
--- /anuga_core/source_numpy_conversion/anuga/utilities/cg_solve.py	(revision 5888)
+++ /anuga_core/source_numpy_conversion/anuga/utilities/cg_solve.py	(revision 5889)
@@ -1,7 +1,9 @@
+
 import exceptions
 class VectorShapeError(exceptions.Exception): pass
 class ConvergenceError(exceptions.Exception): pass
 
-from Numeric import dot, array, Float, zeros
+##from numpy.oldnumeric import dot, array, Float, zeros
+from numpy import dot, array, float, zeros
    
 import logging, logging.config
@@ -24,9 +26,9 @@
     
     if x0 is None:
-        x0 = zeros(b.shape, typecode=Float)
+        x0 = zeros(b.shape, dtype=float)
     else:
-        x0 = array(x0, typecode=Float)
+        x0 = array(x0, dtype=float)
 
-    b  = array(b, typecode=Float)
+    b  = array(b, dtype=float)
     if len(b.shape) != 1 :
        
@@ -57,12 +59,12 @@
 
 
-   b  = array(b, typecode=Float)
+   b  = array(b, dtype=float)
    if len(b.shape) != 1 :
       raise VectorShapeError, 'input vector should consist of only one column'
 
    if x0 is None:
-      x0 = zeros(b.shape, typecode=Float)
+      x0 = zeros(b.shape, dtype=float)
    else:
-      x0 = array(x0, typecode=Float)
+      x0 = array(x0, dtype=float)
 
 
Index: /anuga_core/source_numpy_conversion/anuga/utilities/compile.py
===================================================================
--- /anuga_core/source_numpy_conversion/anuga/utilities/compile.py	(revision 5888)
+++ /anuga_core/source_numpy_conversion/anuga/utilities/compile.py	(revision 5889)
@@ -10,4 +10,15 @@
    Ole Nielsen, Duncan Gray Oct 2001      
 """     
+
+#NumPy ------------------------------------
+# these lines recommended in "Converting from NUMARRAY to NUMPY"
+import numpy
+import numpy.numarray as nn
+numpyincludedirs = numpy.get_include()
+numarrayincludedirs = nn.get_numarray_include_dirs()
+I_dirs = '-I"%s" ' % numpyincludedirs
+for d in numarrayincludedirs:
+    I_dirs += '-I"%s" ' % d
+#NumPy ------------------------------------
 
 # FIXME (Ole): Although this script says it works with a range of compilers,
@@ -255,9 +266,11 @@
     else:
       if FN == "triangle.c" or FN == "mesh_engine_c_layer.c":
-        s = '%s -c %s -I"%s" -I"%s" -o "%s.o" -O3 -DTRILIBRARY=1 -DNO_TIMER=1'\
-            %(compiler, FN, python_include, utilities_include_dir, root)
+#NumPy        s = '%s -c %s -I"%s" -I"%s" -o "%s.o" -O3 -DTRILIBRARY=1 -DNO_TIMER=1'\
+        s = '%s -c %s %s -I"%s" -I"%s" -o "%s.o" -O3 -DTRILIBRARY=1 -DNO_TIMER=1'\
+            %(compiler, FN, I_dirs, python_include, utilities_include_dir, root)
       else:
-        s = '%s -c %s -I"%s" -I"%s" -o "%s.o" -Wall -O3'\
-            %(compiler, FN, python_include, utilities_include_dir, root)
+#NumPy        s = '%s -c %s -I"%s" -I"%s" -o "%s.o" -Wall -O3'\
+        s = '%s -c %s %s -I"%s" -I"%s" -o "%s.o" -Wall -O3'\
+            %(compiler, FN, I_dirs, python_include, utilities_include_dir, root)
 
     if os.name == 'posix' and os.uname()[4] == 'x86_64':
Index: /anuga_core/source_numpy_conversion/anuga/utilities/interp.py
===================================================================
--- /anuga_core/source_numpy_conversion/anuga/utilities/interp.py	(revision 5888)
+++ /anuga_core/source_numpy_conversion/anuga/utilities/interp.py	(revision 5889)
@@ -1,2 +1,4 @@
+## Automatically adapted for numpy.oldnumeric Oct 28, 2008 by alter_code1.py
+
 #!/usr/bin/python -tt
 #=======================================================================
@@ -111,5 +113,5 @@
 
     >>> from interp import interp
-    >>> import Numeric as N
+    >>> import numpy.oldnumeric as N
     >>> x = N.array([1., 2., 3., 4., 5.])
     >>> y = N.array([3., 6., 2.,-5.,-3.])
@@ -138,6 +140,8 @@
     """
     import arrayfns
-    import MA
-    import Numeric as N
+##    import numpy.oldnumeric.ma as MA
+##    import numpy.oldnumeric as N
+    import numpy.ma as MA
+    import numpy as N
     from where_close import where_close
 
@@ -216,5 +220,5 @@
 
     >>> from interp import interp
-    >>> import Numeric as N
+    >>> import numpy.oldnumeric as N
     >>> x = N.array([1.,    2., 3.,  4.,  5.,  6.])
     >>> y = N.array([3., 1e+20, 2., -5., -3., -4.])
@@ -284,5 +288,5 @@
     >>> ['%.7g' % yint[i] for i in range(len(yint))]
     ['3.4', '2.3']
-    >>> yint.typecode()
+    >>> yint.dtype.char
     'd'
     >>> x = N.arange(6)
@@ -292,5 +296,5 @@
     >>> ['%.7g' % yint[i] for i in range(len(yint))]
     ['3', '2']
-    >>> yint.typecode()
+    >>> yint.dtype.char
     'd'
     """}
Index: /anuga_core/source_numpy_conversion/anuga/utilities/numerical_tools.py
===================================================================
--- /anuga_core/source_numpy_conversion/anuga/utilities/numerical_tools.py	(revision 5888)
+++ /anuga_core/source_numpy_conversion/anuga/utilities/numerical_tools.py	(revision 5889)
@@ -14,9 +14,10 @@
 #except:
 #    #print 'Could not find scipy - using Numeric'
-#    from Numeric import ArrayType, array, sum, innerproduct, ravel, sqrt,
+#    from numpy.oldnumeric import ArrayType, array, sum, innerproduct, ravel, sqrt,
 #searchsorted, sort, concatenate, Float, arange
 
-from Numeric import ArrayType, array, sum, innerproduct, ravel, sqrt,\
-     searchsorted, sort, concatenate, Float, arange    
+##from numpy.oldnumeric import ArrayType, array, sum, innerproduct, ravel, sqrt,\
+##     searchsorted, sort, concatenate, Float, arange    
+from numpy import ndarray, array, sum, inner, ravel, sqrt, searchsorted, sort, concatenate, float, arange    
 
 # Getting an infinite number to use when using Numeric
@@ -89,6 +90,6 @@
         v2 = [1.0, 0.0] # Unit vector along the x-axis
 	
-    v1 = ensure_numeric(v1, Float)
-    v2 = ensure_numeric(v2, Float)    
+    v1 = ensure_numeric(v1, float)
+    v2 = ensure_numeric(v2, float)    
     
     # Normalise
@@ -97,6 +98,6 @@
 
     # Compute angle
-    p = innerproduct(v1, v2)
-    c = innerproduct(v1, normal_vector(v2)) # Projection onto normal
+    p = inner(v1, v2)
+    c = inner(v1, normal_vector(v2)) # Projection onto normal
                                             # (negative cross product)
         
@@ -140,5 +141,5 @@
     """
     
-    return array([-v[1], v[0]], Float)
+    return array([-v[1], v[0]], float)
 
     
@@ -171,5 +172,5 @@
     cy = y - mean(y)  
 
-    p = innerproduct(cx,cy)/N
+    p = inner(cx,cy)/N
     return(p)
 
@@ -221,5 +222,5 @@
   
     y = ravel(x)
-    p = sqrt(innerproduct(y,y))
+    p = sqrt(inner(y,y))
     return p
     
@@ -262,17 +263,23 @@
 
     if typecode is None:
-        if type(A) == ArrayType:
+##NumPy        if isinstance(A, ArrayType):
+        if type(A) == ndarray:
             return A
         else:
             return array(A)
     else:
-        if type(A) == ArrayType:
-            if A.typecode == typecode:
+##NumPy        if isinstance(A, ArrayType):
+        if type(A) == ndarray:
+##NumPy            if A.typecode == typecode:
+            if A.dtype == typecode:
                 return array(A)  #FIXME: Shouldn't this just return A?
             else:
-                return array(A,typecode)
+                return array(A, typecode)
         else:
-            return array(A,typecode)
-
+            import types                            ##
+            from numpy import str                   ##
+            if isinstance(A, types.StringType):     ##
+                return array(A, dtype=int)          ##
+            return array(A, typecode)
 
 
Index: /anuga_core/source_numpy_conversion/anuga/utilities/polygon.py
===================================================================
--- /anuga_core/source_numpy_conversion/anuga/utilities/polygon.py	(revision 5888)
+++ /anuga_core/source_numpy_conversion/anuga/utilities/polygon.py	(revision 5889)
@@ -10,5 +10,5 @@
 #    #print 'Could not find scipy - using Numeric'
 
-from Numeric import Float, Int, zeros, ones, array, concatenate, reshape, dot, allclose
+from numpy import float, int, zeros, ones, array, concatenate, reshape, dot, allclose, newaxis, ascontiguousarray
 
 
@@ -76,6 +76,6 @@
     # FIXME (Ole): Write this in C
 
-    line0 = ensure_numeric(line0, Float)
-    line1 = ensure_numeric(line1, Float)    
+    line0 = ensure_numeric(line0, float)
+    line1 = ensure_numeric(line1, float)    
 
     x0 = line0[0,0]; y0 = line0[0,1]
@@ -203,6 +203,6 @@
 
 
-    line0 = ensure_numeric(line0, Float)
-    line1 = ensure_numeric(line1, Float)    
+    line0 = ensure_numeric(line0, float)
+    line1 = ensure_numeric(line1, float)    
 
     status, value = _intersection(line0[0,0], line0[0,1],
@@ -256,5 +256,5 @@
         # converted to a numeric array.
         msg = 'Points could not be converted to Numeric array' 
-	raise msg
+	raise TypeError, msg
 
     try:
@@ -265,6 +265,6 @@
         # If this fails it is going to be because the points can't be
         # converted to a numeric array.
-        msg = 'Polygon %s could not be converted to Numeric array' %(str(polygon))
-	raise msg
+        msg = 'Polygon %s could not be converted to Numeric array' % (str(polygon))
+	raise TypeError, msg
 
     if len(points.shape) == 1:
@@ -312,5 +312,5 @@
     #if verbose: print 'Checking input to outside_polygon'
     try:
-        points = ensure_numeric(points, Float)
+        points = ensure_numeric(points, float)
     except NameError, e:
         raise NameError, e
@@ -320,5 +320,5 @@
 
     try:
-        polygon = ensure_numeric(polygon, Float)
+        polygon = ensure_numeric(polygon, float)
     except NameError, e:
         raise NameError, e
@@ -354,5 +354,5 @@
     #if verbose: print 'Checking input to outside_polygon'
     try:
-        points = ensure_numeric(points, Float)
+        points = ensure_numeric(points, float)
     except NameError, e:
         raise NameError, e
@@ -362,5 +362,5 @@
 
     try:
-        polygon = ensure_numeric(polygon, Float)
+        polygon = ensure_numeric(polygon, float)
     except NameError, e:
         raise NameError, e
@@ -439,21 +439,24 @@
     assert isinstance(verbose, bool), 'Keyword argument "verbose" must be boolean'
 
-
+##    print 'Before: points=%s, flags=%s' % (type(points), str(points.flags))
     try:
-        points = ensure_numeric(points, Float)
+##        points = ascontiguousarray(ensure_numeric(points, float))
+        points = ensure_numeric(points, float)
     except NameError, e:
         raise NameError, e
     except:
         msg = 'Points could not be converted to Numeric array'
-	raise msg
+	raise TypeError, msg
+##    print 'After: points=%s, flags=%s' % (type(points), str(points.flags))
 
     #if verbose: print 'Checking input to separate_points_by_polygon 2'
     try:
-        polygon = ensure_numeric(polygon, Float)
+##        polygon = ascontiguousarray(ensure_numeric(polygon, float))
+        polygon = ensure_numeric(polygon, float)
     except NameError, e:
         raise NameError, e
     except:
         msg = 'Polygon could not be converted to Numeric array'
-	raise msg
+	raise TypeError, msg
 
     msg = 'Polygon array must be a 2d array of vertices'
@@ -476,5 +479,5 @@
     
     msg = 'Point array must have two columns (x,y), '
-    msg += 'I got points.shape[1] == %d' %points.shape[0]
+    msg += 'I got points.shape[1] == %d' % points.shape[1]
     assert points.shape[1] == 2, msg
 
@@ -491,5 +494,5 @@
 
 
-    indices = zeros( M, Int )
+    indices = zeros( M, int )
 
     count = _separate_points_by_polygon(points, polygon, indices,
@@ -618,5 +621,5 @@
 
     try:
-        polygon = ensure_numeric(polygon, Float)
+        polygon = ensure_numeric(polygon, float)
     except NameError, e:
         raise NameError, e
@@ -680,5 +683,5 @@
     """
 
-    def __init__(self, regions, default=0.0, geo_reference=None):
+    def __init__(self, regions, default=0.0, geo_reference=None, verbose=False):
 
 	try:
@@ -723,24 +726,27 @@
             self.regions.append( (P, value) )
 
+        self.verbose = verbose
+
 
 
 
     def __call__(self, x, y):
-	x = array(x).astype(Float)
-	y = array(y).astype(Float)
-
-	N = len(x)
-	assert len(y) == N
-
-	points = concatenate( (reshape(x, (N, 1)),
-	                       reshape(y, (N, 1))), axis=1 )
-
+	x = array(x).astype(float)
+	y = array(y).astype(float)
+
+        assert len(x.shape) == 1 and len(y.shape) == 1
+        
+	N = x.shape[0]
+	assert y.shape[0] == N
+
+	points = ascontiguousarray(concatenate( (x[:,newaxis], y[:,newaxis]), axis=1 ))
+	
 	if callable(self.default):
-	    z = self.default(x,y)
+	    z = self.default(x, y)
 	else:
-	    z = ones(N, Float) * self.default
+	    z = ones(N, float) * self.default
 
 	for polygon, value in self.regions:
-	    indices = inside_polygon(points, polygon)
+	    indices = inside_polygon(points, polygon, verbose=self.verbose)
 
 	    # FIXME: This needs to be vectorised
Index: /anuga_core/source_numpy_conversion/anuga/utilities/polygon_ext.c
===================================================================
--- /anuga_core/source_numpy_conversion/anuga/utilities/polygon_ext.c	(revision 5888)
+++ /anuga_core/source_numpy_conversion/anuga/utilities/polygon_ext.c	(revision 5889)
@@ -15,5 +15,5 @@
 
 #include "Python.h"
-#include "Numeric/arrayobject.h"
+#include "numpy/arrayobject.h"
 #include "math.h"
 
@@ -222,11 +222,11 @@
   }  
   for (k=0; k<M; k++) {
+    x = points[2*k];
+    y = points[2*k + 1];
+
     if (verbose){
-      if (k %((M+10)/10)==0) printf("Doing %d of %d\n", k, M);
+      if (k %((M+10)/10)==0) printf("Doing %d of %d, x=%f, y=%f\n", k, M, x, y);
     }
     
-    x = points[2*k];
-    y = points[2*k + 1];
-
     inside = 0;
 
@@ -376,4 +376,5 @@
     *polygon,
     *indices;
+//  PyObject *xxxx;
 
   int closed, verbose; //Flags
@@ -393,4 +394,6 @@
     return NULL;
   }
+  
+//  points = (PyArrayObject *) PyArray_ContiguousFromObject(xxxx, PyArray_DOUBLE, 1, 1);
 
   M = points -> dimensions[0];   //Number of points
Index: /anuga_core/source_numpy_conversion/anuga/utilities/quad.py
===================================================================
--- /anuga_core/source_numpy_conversion/anuga/utilities/quad.py	(revision 5888)
+++ /anuga_core/source_numpy_conversion/anuga/utilities/quad.py	(revision 5889)
@@ -1,2 +1,3 @@
+
 """quad.py - quad tree data structure for fast indexing of points in the plane
 
@@ -222,12 +223,12 @@
             triangles = {}
             verts = self.retrieve_vertices()
-            # print "verts", verts
+            print "verts", verts
             for vert in verts:
                 triangle_list = self.mesh.get_triangles_and_vertices_per_node(vert)
+                print 'triangle_list=%s' % str(triangle_list)
                 for k, _ in triangle_list:
                     if not triangles.has_key(k):
                         # print 'k',k
-                        tri = self.mesh.get_vertex_coordinates(k,
-                                                               absolute=True)
+                        tri = self.mesh.get_vertex_coordinates(k, absolute=True)
                         n0 = self.mesh.get_normal(k, 0)
                         n1 = self.mesh.get_normal(k, 1)
@@ -435,5 +436,5 @@
     """
 
-    from Numeric import minimum, maximum
+    from numpy import minimum, maximum
 
 
Index: /anuga_core/source_numpy_conversion/anuga/utilities/sparse.py
===================================================================
--- /anuga_core/source_numpy_conversion/anuga/utilities/sparse.py	(revision 5888)
+++ /anuga_core/source_numpy_conversion/anuga/utilities/sparse.py	(revision 5889)
@@ -1,2 +1,3 @@
+
 """Proof of concept sparse matrix code
 """
@@ -17,5 +18,5 @@
             
         if len(args) == 1:
-            from Numeric import array
+            from numpy import array
             try:
                 A = array(args[0])
@@ -92,7 +93,7 @@
 
     def todense(self):
-        from Numeric import zeros, Float
-
-        D = zeros( (self.M, self.N), Float)
+        from numpy import zeros, float
+
+        D = zeros( (self.M, self.N), float)
         
         for i in range(self.M):
@@ -109,5 +110,5 @@
         """
 
-        from Numeric import array, zeros, Float
+        from numpy import array, zeros, float
         
         try:
@@ -130,5 +131,5 @@
             assert B.shape[0] == self.N, msg
 
-            R = zeros(self.M, Float) #Result
+            R = zeros(self.M, float) #Result
 	    
             # Multiply nonzero elements
@@ -140,5 +141,5 @@
 	
             
-            R = zeros((self.M, B.shape[1]), Float) #Result matrix
+            R = zeros((self.M, B.shape[1]), float) #Result matrix
 
             # Multiply nonzero elements
@@ -162,6 +163,4 @@
         """
 
-        from Numeric import array, zeros, Float
-        
         new = other.copy()
         for key in self.Data.keys():
@@ -177,6 +176,4 @@
         """
 
-        from Numeric import array, zeros, Float
-        
         try:
             other = float(other)
@@ -200,5 +197,5 @@
         """
 
-        from Numeric import array, zeros, Float
+        from numpy import array, zeros, float
         
         try:
@@ -214,5 +211,5 @@
             assert B.shape[0] == self.M, 'Mismatching dimensions'
 
-            R = zeros((self.N,), Float) #Result
+            R = zeros((self.N,), float) #Result
 
             #Multiply nonzero elements
@@ -251,15 +248,14 @@
         """
 
-        from Numeric import array, Float, Int
+        from numpy import zeros, float, int
 
         if isinstance(A,Sparse):
 
-            from Numeric import zeros
             keys = A.Data.keys()
             keys.sort()
             nnz = len(keys)
-            data    = zeros ( (nnz,), Float)
-            colind  = zeros ( (nnz,), Int)
-            row_ptr = zeros ( (A.M+1,), Int)
+            data    = zeros ( (nnz,), float)
+            colind  = zeros ( (nnz,), int)
+            row_ptr = zeros ( (A.M+1,), int)
             current_row = -1
             k = 0
@@ -299,5 +295,5 @@
 
     def todense(self):
-        from Numeric import zeros, Float
+        from numpy.oldnumeric import zeros, Float
 
         D = zeros( (self.M, self.N), Float)
@@ -314,5 +310,5 @@
         """
 
-        from Numeric import array, zeros, Float
+        from numpy.oldnumeric import array, zeros, Float
         
         try:
@@ -334,5 +330,5 @@
     # A little selftest
     
-    from Numeric import allclose, array, Float 
+    from numpy.oldnumeric import allclose, array, Float 
     
     A = Sparse(3,3)
Index: /anuga_core/source_numpy_conversion/anuga/utilities/sparse_ext.c
===================================================================
--- /anuga_core/source_numpy_conversion/anuga/utilities/sparse_ext.c	(revision 5888)
+++ /anuga_core/source_numpy_conversion/anuga/utilities/sparse_ext.c	(revision 5889)
@@ -11,5 +11,5 @@
 	
 #include "Python.h"
-#include "Numeric/arrayobject.h"
+#include "numpy/arrayobject.h"
 #include "math.h"
 #include "stdio.h"
Index: /anuga_core/source_numpy_conversion/anuga/utilities/test_cg_solve.py
===================================================================
--- /anuga_core/source_numpy_conversion/anuga/utilities/test_cg_solve.py	(revision 5888)
+++ /anuga_core/source_numpy_conversion/anuga/utilities/test_cg_solve.py	(revision 5889)
@@ -6,5 +6,5 @@
 
 
-from Numeric import dot, allclose, array, transpose, arange, ones, Float
+from numpy import dot, allclose, array, transpose, arange, ones, float
 from anuga.utilities.cg_solve import *
 from anuga.utilities.cg_solve import _conjugate_gradient
@@ -68,5 +68,5 @@
                 A[i,i+1] = -0.5
 
-        xe = ones( (n,), Float)
+        xe = ones( (n,), float)
 
         b  = A*xe
@@ -96,5 +96,5 @@
                     A[I,I+1] = -1.0
 
-        xe = ones( (n*m,), Float)
+        xe = ones( (n*m,), float)
 
         b  = A*xe
@@ -125,5 +125,5 @@
                     A[I,I+1] = -1.0
 
-        xe = ones( (n*m,), Float)
+        xe = ones( (n*m,), float)
 
         # Convert to csr format
@@ -158,5 +158,5 @@
                     A[I,I+1] = -1.0
 
-        xe = ones( (n*m,), Float)
+        xe = ones( (n*m,), float)
 
         b  = A*xe
Index: /anuga_core/source_numpy_conversion/anuga/utilities/test_data_audit.py
===================================================================
--- /anuga_core/source_numpy_conversion/anuga/utilities/test_data_audit.py	(revision 5888)
+++ /anuga_core/source_numpy_conversion/anuga/utilities/test_data_audit.py	(revision 5889)
@@ -3,5 +3,5 @@
 
 import unittest
-from Numeric import zeros, array, allclose, Float
+from numpy.oldnumeric import zeros, array, allclose
 from tempfile import mkstemp
 import os
Index: /anuga_core/source_numpy_conversion/anuga/utilities/test_numerical_tools.py
===================================================================
--- /anuga_core/source_numpy_conversion/anuga/utilities/test_numerical_tools.py	(revision 5888)
+++ /anuga_core/source_numpy_conversion/anuga/utilities/test_numerical_tools.py	(revision 5889)
@@ -3,6 +3,6 @@
 
 import unittest
-from Numeric import zeros, array, allclose
-from Numeric import ArrayType, Float, Int, array, alltrue
+from numpy import zeros, array, allclose
+from numpy import ndarray, float, int, array, alltrue
 
 from math import sqrt, pi
@@ -68,37 +68,37 @@
         A = [1,2,3,4]
         B = ensure_numeric(A)
-        assert type(B) == ArrayType
-        assert B.typecode() == 'l'
+        assert isinstance(B, ndarray)
+        assert B.dtype.char == 'l'
         assert B[0] == 1 and B[1] == 2 and B[2] == 3 and B[3] == 4
 
         A = [1,2,3.14,4]
         B = ensure_numeric(A)
-        assert type(B) == ArrayType
-        assert B.typecode() == 'd'
+        assert isinstance(B, ndarray)
+        assert B.dtype.char == 'd'
         assert B[0] == 1 and B[1] == 2 and B[2] == 3.14 and B[3] == 4
 
         A = [1,2,3,4]
-        B = ensure_numeric(A, Float)
-        assert type(B) == ArrayType
-        assert B.typecode() == 'd'
+        B = ensure_numeric(A, float)
+        assert isinstance(B, ndarray)
+        assert B.dtype.char == 'd'
         assert B[0] == 1.0 and B[1] == 2.0 and B[2] == 3.0 and B[3] == 4.0
 
         A = [1,2,3,4]
-        B = ensure_numeric(A, Float)
-        assert type(B) == ArrayType
-        assert B.typecode() == 'd'
+        B = ensure_numeric(A, float)
+        assert isinstance(B, ndarray)
+        assert B.dtype.char == 'd'
         assert B[0] == 1.0 and B[1] == 2.0 and B[2] == 3.0 and B[3] == 4.0
 
         A = array([1,2,3,4])
         B = ensure_numeric(A)
-        assert type(B) == ArrayType
-        assert B.typecode() == 'l'        
+        assert isinstance(B, ndarray)
+        assert B.dtype.char == 'l'        
         assert alltrue(A == B)    
         assert A is B   #Same object
 
         A = array([1,2,3,4])
-        B = ensure_numeric(A, Float)
-        assert type(B) == ArrayType
-        assert B.typecode() == 'd'        
+        B = ensure_numeric(A, float)
+        assert isinstance(B, ndarray)
+        assert B.dtype.char == 'd'        
         assert alltrue(A == B)    
         assert A is not B   #Not the same object
@@ -106,17 +106,18 @@
         # Check scalars
         A = 1
-        B = ensure_numeric(A, Float)
+        B = ensure_numeric(A, float)
         #print A, B[0], len(B), type(B) 
         #print B.shape
         assert alltrue(A == B)
 
-        B = ensure_numeric(A, Int)        
+        B = ensure_numeric(A, int)        
         #print A, B
         #print B.shape
         assert alltrue(A == B)
 
+    def NO_test_ensure_numeric_char(self):
         # Error situation
-
-        B = ensure_numeric('hello', Int)                
+        B = ensure_numeric('hello', int)
+        print 'B=%s %s' % (str(B), type(B))
         assert allclose(B, [104, 101, 108, 108, 111])
 
@@ -160,5 +161,5 @@
         zx, zy = gradient(x0, y0, x1, y1, x2, y2, z0, z1, z2)
         a, b = gradient2(x0, y0, x1, y1, z0, z1)
-
+        
         assert zx == a
         assert zy == b
@@ -281,6 +282,6 @@
         from util_ext import gradient as gradient_c
 
-        from RandomArray import uniform, seed
-        seed(17, 53)
+        from numpy.random import uniform, seed
+        seed(53)    # numeric was seed(17, 53)
 
         x0, x1, x2, y0, y1, y2 = uniform(0.0,3.0,6)
@@ -312,4 +313,5 @@
         # sqrt(sum_over_x&y((xi - yi)^2))
         err__1 = err(x,y,2,False)
+        
         assert err__1 == sqrt(20)
         #print "err_", err_
Index: /anuga_core/source_numpy_conversion/anuga/utilities/test_polygon.py
===================================================================
--- /anuga_core/source_numpy_conversion/anuga/utilities/test_polygon.py	(revision 5888)
+++ /anuga_core/source_numpy_conversion/anuga/utilities/test_polygon.py	(revision 5889)
@@ -3,5 +3,5 @@
 
 import unittest
-from Numeric import zeros, array, allclose
+from numpy import zeros, array, allclose, alltrue
 from math import sqrt, pi
 from anuga.utilities.numerical_tools import ensure_numeric
@@ -43,5 +43,5 @@
         p2 = [[0,0], [10,10], [15,5], [20, 10], [25,0], [30,10], [40,-10]]
 
-	f = Polygon_function( [(p1, 1.0)] )
+	f = Polygon_function( [(p1, 1.0)], verbose=False )
 	z = f([5, 5, 27, 35], [5, 9, 8, -5]) #Two first inside p1
 	assert allclose(z, [1,1,0,0])
@@ -57,4 +57,11 @@
 	z = f([5, 5, 27, 35], [5, 9, 8, -5])
 	assert allclose(z, [2,1,0,2])
+
+
+    def test_polygon_function_constants_tuple(self):
+        polygon = [[0,0], [10,0], [10,10], [0,10]]
+        points = ((5, 5), (5, 9), (27, 8), (35, -5))
+
+        (indices, count) = separate_points_by_polygon(points, polygon, verbose=False)
 
     def test_polygon_function_csvfile(self):
@@ -210,5 +217,5 @@
 	res = inside_polygon(points, polygon)
 	assert len(res) == 2
-	assert allclose(res, [0,1])
+	assert allclose(res, [0,1])     ## alltrue?
 
 
@@ -990,5 +997,5 @@
 if __name__ == "__main__":
     suite = unittest.makeSuite(Test_Polygon,'test')
-    #suite = unittest.makeSuite(Test_Polygon,'test_inside_polygon_geo_ref')
+##    suite = unittest.makeSuite(Test_Polygon,'test_polygon_function_constantsX')
     runner = unittest.TextTestRunner()
     runner.run(suite)
Index: /anuga_core/source_numpy_conversion/anuga/utilities/test_quad.py
===================================================================
--- /anuga_core/source_numpy_conversion/anuga/utilities/test_quad.py	(revision 5888)
+++ /anuga_core/source_numpy_conversion/anuga/utilities/test_quad.py	(revision 5889)
@@ -1,4 +1,4 @@
 import unittest
-from Numeric import array, allclose
+from numpy import array, allclose
 
 from quad import Cell, build_quadtree
Index: /anuga_core/source_numpy_conversion/anuga/utilities/test_sparse.py
===================================================================
--- /anuga_core/source_numpy_conversion/anuga/utilities/test_sparse.py	(revision 5888)
+++ /anuga_core/source_numpy_conversion/anuga/utilities/test_sparse.py	(revision 5889)
@@ -5,5 +5,5 @@
 
 from sparse import *
-from Numeric import allclose, array, transpose, Float
+from numpy.oldnumeric import allclose, array, transpose
 
 class Test_Sparse(unittest.TestCase):
Index: /anuga_core/source_numpy_conversion/anuga/utilities/test_system_tools.py
===================================================================
--- /anuga_core/source_numpy_conversion/anuga/utilities/test_system_tools.py	(revision 5888)
+++ /anuga_core/source_numpy_conversion/anuga/utilities/test_system_tools.py	(revision 5889)
@@ -3,5 +3,5 @@
 
 import unittest
-from Numeric import zeros, array, allclose, Float
+from numpy import zeros, array, allclose, float, dtype
 import zlib
 from os.path import join, split, sep
@@ -87,6 +87,5 @@
             fid = NetCDFFile(filename1, 'w')
             fid.createDimension('two', 2)
-            fid.createVariable('test_array', Float,
-                               ('two', 'two'))
+            fid.createVariable('test_array', dtype(float).char, ('two', 'two'))
             fid.variables['test_array'][:] = test_array
             fid.close()
@@ -96,6 +95,5 @@
             fid = NetCDFFile(filename2, 'w')
             fid.createDimension('two', 2)
-            fid.createVariable('test_array', Float,
-                               ('two', 'two'))
+            fid.createVariable('test_array', dtype(float).char, ('two', 'two'))
             fid.variables['test_array'][:] = test_array
             fid.close()
Index: /anuga_core/source_numpy_conversion/anuga/utilities/test_xml_tools.py
===================================================================
--- /anuga_core/source_numpy_conversion/anuga/utilities/test_xml_tools.py	(revision 5888)
+++ /anuga_core/source_numpy_conversion/anuga/utilities/test_xml_tools.py	(revision 5889)
@@ -3,5 +3,4 @@
 
 import unittest
-from Numeric import zeros, array, allclose, Float
 from tempfile import mkstemp, mktemp
 
Index: /anuga_core/source_numpy_conversion/anuga/utilities/util_ext.c
===================================================================
--- /anuga_core/source_numpy_conversion/anuga/utilities/util_ext.c	(revision 5888)
+++ /anuga_core/source_numpy_conversion/anuga/utilities/util_ext.c	(revision 5889)
@@ -16,5 +16,5 @@
 
 #include "Python.h"
-#include "Numeric/arrayobject.h"
+#include "numpy/arrayobject.h"
 #include "math.h"
 
Index: /anuga_core/source_numpy_conversion/anuga/utilities/util_ext.h
===================================================================
--- /anuga_core/source_numpy_conversion/anuga/utilities/util_ext.h	(revision 5888)
+++ /anuga_core/source_numpy_conversion/anuga/utilities/util_ext.h	(revision 5889)
@@ -11,5 +11,5 @@
 	
 #include "Python.h"	
-#include "Numeric/arrayobject.h"
+#include "numpy/arrayobject.h"
 #include "math.h"
 
