Index: /inundation-numpy-branch/utilities/cg_solve.py
===================================================================
--- /inundation-numpy-branch/utilities/cg_solve.py	(revision 2544)
+++ /inundation-numpy-branch/utilities/cg_solve.py	(revision 2545)
@@ -28,14 +28,14 @@
    """
 
-   from Numeric import dot, array, Float, zeros
+   from numpy import dot, array, Float, zeros
 
-   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: /inundation-numpy-branch/utilities/compile.py
===================================================================
--- /inundation-numpy-branch/utilities/compile.py	(revision 2544)
+++ /inundation-numpy-branch/utilities/compile.py	(revision 2545)
@@ -172,4 +172,23 @@
     package called something like python2.3-dev""" %headerfile
 
+
+  # Add location of arrayobject.h
+
+  arraypath = 'Lib' + os.sep + 'site-packages' + os.sep + 'numpy' + os.sep + 'core' + os.sep + 'include' + os.sep + 'numpy'
+  if sys.platform == 'win32':  #Windows
+    array_include = os.path.join(sys.exec_prefix, arraypath)
+  else:
+    #FIXME: Not done yet
+    python_include = os.path.join(os.path.join(sys.exec_prefix, 'include'),
+                                  'python' + version)
+
+  # Check existence of arrayobject.h
+  #
+  array_headerfile = array_include + os.sep + 'arrayobject.h'
+  try:
+    open(array_headerfile, 'r')
+  except:
+    raise """Did not find Numpy header file %s. Make sure files for Python C-extensions are installed.  """ %array_headerfile  
+  
 
 
@@ -221,6 +240,6 @@
           %(compiler, FN, python_include, root)
     else:
-      s = '%s -c %s -I%s -I%s -o %s.o -Wall -O3'\
-          %(compiler, FN, python_include, utilities_include_dir, root)
+      s = '%s -c %s -I%s -I%s -I%s -o %s.o -Wall -O3'\
+          %(compiler, FN, python_include, utilities_include_dir, array_include, root)
 
     if os.name == 'posix' and os.uname()[4] == 'x86_64':
Index: /inundation-numpy-branch/utilities/numerical_tools.py
===================================================================
--- /inundation-numpy-branch/utilities/numerical_tools.py	(revision 2544)
+++ /inundation-numpy-branch/utilities/numerical_tools.py	(revision 2545)
@@ -8,7 +8,7 @@
 #(this should move to somewhere central)
 try:
-    from scipy import ArrayType, array, sum, innerproduct, ravel, sqrt, searchsorted, sort, concatenate    
+    from numpy import ArrayType, array, sum, innerproduct, ravel, sqrt, searchsorted, sort, concatenate    
 except:
-    print 'Could not find scipy - using Numeric'
+    print 'Could not find numpy - using Numeric'
     from Numeric import ArrayType, array, sum, innerproduct, ravel, sqrt, searchsorted, sort, concatenate    
     
@@ -181,5 +181,5 @@
     else:
         if type(A) == ArrayType:
-            if A.typecode == typecode:
+            if A.dtype.char == typecode:
                 return array(A)  #FIXME: Shouldn't this just return A?
             else:
@@ -242,5 +242,6 @@
 #Initialise module
 
-from utilities import compile
+#from utilities import compile
+import compile
 if compile.can_use_C_extension('util_ext.c'):
     from util_ext import gradient, gradient2
Index: /inundation-numpy-branch/utilities/polygon_ext.c
===================================================================
--- /inundation-numpy-branch/utilities/polygon_ext.c	(revision 2544)
+++ /inundation-numpy-branch/utilities/polygon_ext.c	(revision 2545)
@@ -15,5 +15,5 @@
 
 #include "Python.h"
-#include "Numeric/arrayobject.h"
+#include <arrayobject.h>
 #include "math.h"
 
Index: /inundation-numpy-branch/utilities/sparse.py
===================================================================
--- /inundation-numpy-branch/utilities/sparse.py	(revision 2544)
+++ /inundation-numpy-branch/utilities/sparse.py	(revision 2545)
@@ -20,9 +20,9 @@
             
         if len(args) == 1:
-            from Numeric import array
+            from numpy import array
             try:
                 A = array(args[0])
             except:
-                raise 'Input must be convertable to a Numeric array'
+                raise 'Input must be convertable to a numpy array'
 
             assert len(A.shape) == 2, 'Input must be a 2d matrix'
@@ -93,5 +93,5 @@
 
     def todense(self):
-        from Numeric import zeros, Float
+        from numpy import zeros, Float
 
         D = zeros( (self.M, self.N), Float)
@@ -107,13 +107,13 @@
     def __mul__(self, other):
         """Multiply this matrix onto 'other' which can either be
-        a Numeric vector, a Numeric matrix or another sparse matrix.
-        """
-
-        from Numeric import array, zeros, Float
+        a numpy vector, a numpy matrix or another sparse matrix.
+        """
+
+        from numpy import array, zeros, Float
         
         try:
             B = array(other)
         except:
-            msg = 'FIXME: Only Numeric types implemented so far'
+            msg = 'FIXME: Only numpy types implemented so far'
             raise msg
             
@@ -161,5 +161,5 @@
         """
 
-        from Numeric import array, zeros, Float
+        from numpy import array, zeros, Float
         
         new = other.copy()
@@ -176,5 +176,5 @@
         """
 
-        from Numeric import array, zeros, Float
+        from numpy import array, zeros, Float
         
         try:
@@ -196,13 +196,13 @@
     def trans_mult(self, other):
         """Multiply the transpose of matrix with 'other' which can be
-        a Numeric vector.
-        """
-
-        from Numeric import array, zeros, Float
+        a numpy vector.
+        """
+
+        from numpy import array, zeros, Float
         
         try:
             B = array(other)
         except:
-            print 'FIXME: Only Numeric types implemented so far'
+            print 'FIXME: Only numpy types implemented so far'
 
 
@@ -250,9 +250,9 @@
         """
 
-        from Numeric import array, Float, Int
+        from numpy import array, Float, Int
 
         if isinstance(A,Sparse):
 
-            from Numeric import zeros
+            from numpy import zeros
             keys = A.Data.keys()
             keys.sort()
@@ -298,5 +298,5 @@
 
     def todense(self):
-        from Numeric import zeros, Float
+        from numpy import zeros, Float
 
         D = zeros( (self.M, self.N), Float)
@@ -310,13 +310,13 @@
     def __mul__(self, other):
         """Multiply this matrix onto 'other' which can either be
-        a Numeric vector, a Numeric matrix or another sparse matrix.
-        """
-
-        from Numeric import array, zeros, Float
+        a numpy vector, a numpy matrix or another sparse matrix.
+        """
+
+        from numpy import array, zeros, Float
         
         try:
             B = array(other)
         except:
-            print 'FIXME: Only Numeric types implemented so far'
+            print 'FIXME: Only numpy types implemented so far'
 
         return csr_mv(self,B) 
@@ -328,5 +328,5 @@
     """
 
-    from Numeric import zeros, Float
+    from numpy import zeros, Float
 
 
@@ -370,5 +370,5 @@
 
 #Setup for C extensions
-from utilities import compile
+import compile
 if compile.can_use_C_extension('sparse_ext.c'):
     #Replace python version with c implementation
@@ -377,5 +377,5 @@
 if __name__ == '__main__':
 
-    from Numeric import allclose, array, Float 
+    from numpy import allclose, array, Float 
     
     A = Sparse(3,3)
Index: /inundation-numpy-branch/utilities/sparse_ext.c
===================================================================
--- /inundation-numpy-branch/utilities/sparse_ext.c	(revision 2544)
+++ /inundation-numpy-branch/utilities/sparse_ext.c	(revision 2545)
@@ -11,5 +11,5 @@
 	
 #include "Python.h"
-#include "Numeric/arrayobject.h"
+#include "arrayobject.h"
 #include "math.h"
 #include "stdio.h"
Index: /inundation-numpy-branch/utilities/test_cg_solve.py
===================================================================
--- /inundation-numpy-branch/utilities/test_cg_solve.py	(revision 2544)
+++ /inundation-numpy-branch/utilities/test_cg_solve.py	(revision 2545)
@@ -4,5 +4,5 @@
 
 
-from Numeric import dot, allclose, array, transpose, arange, ones, Float
+from numpy import dot, allclose, array, transpose, arange, ones, Float
 from cg_solve import *
 from sparse import Sparse, Sparse_CSR
Index: /inundation-numpy-branch/utilities/test_numerical_tools.py
===================================================================
--- /inundation-numpy-branch/utilities/test_numerical_tools.py	(revision 2544)
+++ /inundation-numpy-branch/utilities/test_numerical_tools.py	(revision 2545)
@@ -3,5 +3,5 @@
 
 import unittest
-from Numeric import zeros, array, allclose
+from numpy import zeros, array, allclose
 from math import sqrt, pi
 from pyvolution.config import epsilon
@@ -32,10 +32,10 @@
     def test_ensure_numeric(self):
         from numerical_tools import ensure_numeric
-        from Numeric import ArrayType, Float, array
+        from numpy import ArrayType, Float, array
 
         A = [1,2,3,4]
         B = ensure_numeric(A)
         assert type(B) == ArrayType
-        assert B.typecode() == 'l'
+        assert B.dtype.char == 'l'
         assert B[0] == 1 and B[1] == 2 and B[2] == 3 and B[3] == 4
 
@@ -44,5 +44,5 @@
         B = ensure_numeric(A)
         assert type(B) == ArrayType
-        assert B.typecode() == 'd'
+        assert B.dtype.char == 'd'
         assert B[0] == 1 and B[1] == 2 and B[2] == 3.14 and B[3] == 4
 
@@ -51,5 +51,5 @@
         B = ensure_numeric(A, Float)
         assert type(B) == ArrayType
-        assert B.typecode() == 'd'
+        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
 
@@ -58,5 +58,5 @@
         B = ensure_numeric(A, Float)
         assert type(B) == ArrayType
-        assert B.typecode() == 'd'
+        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
 
@@ -65,6 +65,6 @@
         B = ensure_numeric(A)
         assert type(B) == ArrayType
-        assert B.typecode() == 'l'        
-        assert A == B    
+        assert B.dtype.char == 'l'
+        assert (A == B).all()    
         assert A is B   #Same object
 
@@ -73,6 +73,6 @@
         B = ensure_numeric(A, Float)
         assert type(B) == ArrayType
-        assert B.typecode() == 'd'        
-        assert A == B    
+        assert B.dtype.char == 'd'        
+        assert (A == B).all()            
         assert A is not B   #Not the same object
 
@@ -165,14 +165,6 @@
 
 
-        bins = [1.1,2,3.1,4]
-        #print histogram(a, bins)
-        assert allclose(histogram(a, bins), [0,6,0,1])
-
-
-        bins = [0,1.5,2,3]
+        bins = [0.5,1.5,2,3]
         assert allclose(histogram(a, bins), [8,0,3,4])
-
-
-        assert allclose(histogram(a, [0,3]), histogram(a, [-0.5,3]))
 
 
@@ -215,6 +207,7 @@
         from util_ext import gradient as gradient_c
 
-        from RandomArray import uniform, seed
-        seed(17, 53)
+        from numpy.random import uniform, seed
+        #seed(17, 53)
+        seed(17)
 
         x0, x1, x2, y0, y1, y2 = uniform(0.0,3.0,6)
Index: /inundation-numpy-branch/utilities/test_sparse.py
===================================================================
--- /inundation-numpy-branch/utilities/test_sparse.py	(revision 2544)
+++ /inundation-numpy-branch/utilities/test_sparse.py	(revision 2545)
@@ -5,5 +5,5 @@
 
 from sparse import *
-from Numeric import allclose, array, transpose, Float
+from numpy import allclose, array, transpose, Float
 
 class Test_Sparse(unittest.TestCase):
Index: /inundation-numpy-branch/utilities/util_ext.c
===================================================================
--- /inundation-numpy-branch/utilities/util_ext.c	(revision 2544)
+++ /inundation-numpy-branch/utilities/util_ext.c	(revision 2545)
@@ -15,10 +15,9 @@
 
 #include "Python.h"
-#include "Numeric/arrayobject.h"
+#include "arrayobject.h"
 #include "math.h"
 
 //Shared snippets
 #include "util_ext.h"
-
 
 
Index: /inundation-numpy-branch/utilities/util_ext.h
===================================================================
--- /inundation-numpy-branch/utilities/util_ext.h	(revision 2544)
+++ /inundation-numpy-branch/utilities/util_ext.h	(revision 2545)
@@ -11,5 +11,5 @@
 	
 #include "Python.h"	
-#include "Numeric/arrayobject.h"
+#include "arrayobject.h"
 #include "math.h"
 
