[Scipy-svn] r2055 - in trunk/Lib: . integrate ndimage ndimage/src signal weave

scipy-svn at scipy.org scipy-svn at scipy.org
Fri Jul 7 22:22:01 EDT 2006


Author: oliphant
Date: 2006-07-07 21:21:54 -0500 (Fri, 07 Jul 2006)
New Revision: 2055

Modified:
   trunk/Lib/integrate/__odepack.h
   trunk/Lib/ndimage/setup.py
   trunk/Lib/ndimage/src/nd_image.h
   trunk/Lib/setup.py
   trunk/Lib/signal/splinemodule.c
   trunk/Lib/weave/c_spec.py
   trunk/Lib/weave/standard_array_spec.py
Log:
Fix so scipy installs and runs tests.

Modified: trunk/Lib/integrate/__odepack.h
===================================================================
--- trunk/Lib/integrate/__odepack.h	2006-07-08 01:51:06 UTC (rev 2054)
+++ trunk/Lib/integrate/__odepack.h	2006-07-08 02:21:54 UTC (rev 2055)
@@ -185,7 +185,7 @@
   lrn = 20 + nyh*(mxordn+1) + 3*neq;
   lrs = 20 + nyh*(mxords+1) + 3*neq + lmat;
 
-  *lrw = MAX(lrn,lrs);
+  *lrw = NPY_MAX(lrn,lrs);
   *liw = 20 + neq;
   return 0;
 

Modified: trunk/Lib/ndimage/setup.py
===================================================================
--- trunk/Lib/ndimage/setup.py	2006-07-08 01:51:06 UTC (rev 2054)
+++ trunk/Lib/ndimage/setup.py	2006-07-08 02:21:54 UTC (rev 2055)
@@ -1,5 +1,6 @@
 from numpy.distutils.core import setup
 from numpy.distutils.misc_util import Configuration
+from numpy.numarray import get_numarray_include_dirs
 
 def configuration(parent_package='', top_path=None):
 
@@ -10,7 +11,7 @@
                  "src/ni_fourier.c","src/ni_interpolation.c",
                  "src/ni_measure.c",
                  "src/ni_morphology.c","src/ni_support.c"],
-        include_dirs=['src'],
+        include_dirs=['src']+get_numarray_include_dirs(),
     )
     
     config.add_data_dir('tests')

Modified: trunk/Lib/ndimage/src/nd_image.h
===================================================================
--- trunk/Lib/ndimage/src/nd_image.h	2006-07-08 01:51:06 UTC (rev 2054)
+++ trunk/Lib/ndimage/src/nd_image.h	2006-07-08 02:21:54 UTC (rev 2055)
@@ -38,7 +38,7 @@
 #include "Python.h"
 #include "numpy/libnumarray.h"
 
-#define NI_MAXDIM MAXDIM
+#define NI_MAXDIM NPY_MAXDIMS
 
 int NI_GetArrayRank(PyArrayObject*);
 NumarrayType NI_GetArrayType(PyArrayObject*);

Modified: trunk/Lib/setup.py
===================================================================
--- trunk/Lib/setup.py	2006-07-08 01:51:06 UTC (rev 2054)
+++ trunk/Lib/setup.py	2006-07-08 02:21:54 UTC (rev 2055)
@@ -19,7 +19,7 @@
     config.add_subpackage('sparse')
     config.add_subpackage('special')
     config.add_subpackage('stats')
-    #config.add_subpackage('ndimage')
+    config.add_subpackage('ndimage')
     config.add_subpackage('weave')
     config.make_svn_version_py()  # installs __svn_version__.py
     config.make_config_py()

Modified: trunk/Lib/signal/splinemodule.c
===================================================================
--- trunk/Lib/signal/splinemodule.c	2006-07-08 01:51:06 UTC (rev 2054)
+++ trunk/Lib/signal/splinemodule.c	2006-07-08 02:21:54 UTC (rev 2055)
@@ -11,7 +11,7 @@
 #define OBJECTTYPE(arr) ((arr)->descr->type_num)
 #define BASEOBJ(arr) ((PyArrayObject *)((arr)->base))
 #define RANK(arr) ((arr)->nd)
-#define ISCONTIGUOUS(m) ((m)->flags & CONTIGUOUS)
+#define ISCONTIGUOUS(m) ((m)->flags & NPY_CONTIGUOUS)
 
 static void convert_strides(npy_intp*,npy_intp*,int,int);
 
@@ -74,7 +74,7 @@
   if (!PyArg_ParseTuple(args, "O|dd", &image, &lambda, &precision)) return NULL;
 
   thetype = PyArray_ObjectType(image, PyArray_FLOAT);
-  thetype = MIN(thetype, PyArray_DOUBLE);
+  thetype = NPY_MIN(thetype, PyArray_DOUBLE);
   a_image = (PyArrayObject *)PyArray_FromObject(image, thetype, 2, 2);
   if (a_image == NULL) goto fail;
  
@@ -133,7 +133,7 @@
   if (lambda != 0.0) PYERR("Smoothing spline not yet implemented.");
 
   thetype = PyArray_ObjectType(image, PyArray_FLOAT);
-  thetype = MIN(thetype, PyArray_DOUBLE);
+  thetype = NPY_MIN(thetype, PyArray_DOUBLE);
   a_image = (PyArrayObject *)PyArray_FromObject(image, thetype, 2, 2);
   if (a_image == NULL) goto fail;
  
@@ -187,7 +187,7 @@
   if (!PyArg_ParseTuple(args, "OOO", &image, &hrow, &hcol)) return NULL;
 
   thetype = PyArray_ObjectType(image, PyArray_FLOAT);
-  thetype = MIN(thetype, PyArray_CDOUBLE);
+  thetype = NPY_MIN(thetype, PyArray_CDOUBLE);
   a_image = (PyArrayObject *)PyArray_FromObject(image, thetype, 2, 2);
   a_hrow = (PyArrayObject *)PyArray_ContiguousFromObject(hrow, thetype, 1, 1);
   a_hcol = (PyArrayObject *)PyArray_ContiguousFromObject(hcol, thetype, 1, 1);
@@ -297,7 +297,7 @@
     return NULL;
 
   thetype = PyArray_ObjectType(sig, PyArray_FLOAT);
-  thetype = MIN(thetype, PyArray_CDOUBLE);
+  thetype = NPY_MIN(thetype, PyArray_CDOUBLE);
   a_sig = (PyArrayObject *)PyArray_FromObject(sig, thetype, 1, 1);
   
   if ((a_sig == NULL)) goto fail;
@@ -417,7 +417,7 @@
     return NULL;
 
   thetype = PyArray_ObjectType(sig, PyArray_FLOAT);
-  thetype = MIN(thetype, PyArray_DOUBLE);
+  thetype = NPY_MIN(thetype, PyArray_DOUBLE);
   a_sig = (PyArrayObject *)PyArray_FromObject(sig, thetype, 1, 1);
   
   if ((a_sig == NULL)) goto fail;

Modified: trunk/Lib/weave/c_spec.py
===================================================================
--- trunk/Lib/weave/c_spec.py	2006-07-08 01:51:06 UTC (rev 2054)
+++ trunk/Lib/weave/c_spec.py	2006-07-08 02:21:54 UTC (rev 2055)
@@ -293,7 +293,7 @@
 num_to_c_types[type(1.)] = 'double'
 num_to_c_types[type(1.+1.j)] = 'std::complex<double> '
 # !! hmmm. The following is likely unsafe...
-num_to_c_types[type(1L)]  = 'longlong'
+num_to_c_types[type(1L)]  = 'npy_longlong'
 
 #----------------------------------------------------------------------------
 # Numeric array Python numeric --> C type maps
@@ -302,22 +302,22 @@
 num_to_c_types['G'] = 'std::complex<longdouble> '
 num_to_c_types['F'] = 'std::complex<float> '
 num_to_c_types['D'] = 'std::complex<double> '
-num_to_c_types['g'] = 'longdouble'
+num_to_c_types['g'] = 'npy_longdouble'
 num_to_c_types['f'] = 'float'
 num_to_c_types['d'] = 'double'
 num_to_c_types['b'] = 'char'
-num_to_c_types['B'] = 'uchar'
-num_to_c_types['B'] = 'ubyte'  # numpy
+num_to_c_types['B'] = 'npy_uchar'
+num_to_c_types['B'] = 'npy_ubyte'  # numpy
 num_to_c_types['h'] = 'short'
-num_to_c_types['H'] = 'ushort'
+num_to_c_types['H'] = 'npy_ushort'
 num_to_c_types['i'] = 'int'
-num_to_c_types['I'] = 'uint'
+num_to_c_types['I'] = 'npy_uint'
 
 num_to_c_types['l'] = 'long'
-num_to_c_types['L'] = 'ulong'
+num_to_c_types['L'] = 'npy_ulong'
 
-num_to_c_types['q'] = 'longlong'
-num_to_c_types['Q'] = 'ulonglong'
+num_to_c_types['q'] = 'npy_longlong'
+num_to_c_types['Q'] = 'npy_ulonglong'
 
 class scalar_converter(common_base_converter):
     def init_info(self):

Modified: trunk/Lib/weave/standard_array_spec.py
===================================================================
--- trunk/Lib/weave/standard_array_spec.py	2006-07-08 01:51:06 UTC (rev 2054)
+++ trunk/Lib/weave/standard_array_spec.py	2006-07-08 02:21:54 UTC (rev 2055)
@@ -169,8 +169,8 @@
                '%(c_type)s %(array_name)s = %(var_convert)s;\n'  \
                'conversion_numpy_check_type(%(array_name)s,%(num_typecode)s,"%(name)s");\n' \
                '%(_code2_)s' \
-               'intp* N%(name)s = %(array_name)s->dimensions;\n' \
-               'intp* S%(name)s = %(array_name)s->strides;\n' \
+               'npy_intp* N%(name)s = %(array_name)s->dimensions;\n' \
+               'npy_intp* S%(name)s = %(array_name)s->strides;\n' \
                'int D%(name)s = %(array_name)s->nd;\n' \
                '%(num_type)s* %(name)s = (%(num_type)s*) %(array_name)s->data;\n'
         code = code % res




More information about the Scipy-svn mailing list