[Numpy-svn] r4777 - in branches/maskedarray: . benchmarks numpy numpy/core numpy/core/code_generators numpy/core/include/numpy numpy/core/src numpy/core/tests numpy/distutils numpy/distutils/command numpy/doc numpy/f2py numpy/fft numpy/lib numpy/lib/tests numpy/linalg numpy/numarray numpy/oldnumeric numpy/random numpy/testing

numpy-svn@scip... numpy-svn@scip...
Fri Feb 8 18:50:06 CST 2008


Author: stefan
Date: 2008-02-08 18:45:11 -0600 (Fri, 08 Feb 2008)
New Revision: 4777

Added:
   branches/maskedarray/numpy/core/SConstruct
   branches/maskedarray/numpy/core/code_generators/__init__.py
   branches/maskedarray/numpy/core/include/numpy/numpyconfig.h.in
   branches/maskedarray/numpy/core/scons_support.py
   branches/maskedarray/numpy/core/setupscons.py
   branches/maskedarray/numpy/distutils/command/scons.py
   branches/maskedarray/numpy/distutils/numpy_distribution.py
   branches/maskedarray/numpy/distutils/setupscons.py
   branches/maskedarray/numpy/f2py/setupscons.py
   branches/maskedarray/numpy/fft/SConstruct
   branches/maskedarray/numpy/fft/setupscons.py
   branches/maskedarray/numpy/lib/SConstruct
   branches/maskedarray/numpy/lib/setupscons.py
   branches/maskedarray/numpy/linalg/SConstruct
   branches/maskedarray/numpy/linalg/setupscons.py
   branches/maskedarray/numpy/numarray/SConstruct
   branches/maskedarray/numpy/numarray/setupscons.py
   branches/maskedarray/numpy/oldnumeric/setupscons.py
   branches/maskedarray/numpy/random/SConstruct
   branches/maskedarray/numpy/random/setupscons.py
   branches/maskedarray/numpy/setupscons.py
   branches/maskedarray/numpy/testing/setupscons.py
   branches/maskedarray/setupscons.py
   branches/maskedarray/test.sh
Modified:
   branches/maskedarray/
   branches/maskedarray/benchmarks/simpleindex.py
   branches/maskedarray/numpy/_import_tools.py
   branches/maskedarray/numpy/add_newdocs.py
   branches/maskedarray/numpy/core/code_generators/generate_array_api.py
   branches/maskedarray/numpy/core/code_generators/generate_ufunc_api.py
   branches/maskedarray/numpy/core/defmatrix.py
   branches/maskedarray/numpy/core/include/numpy/ndarrayobject.h
   branches/maskedarray/numpy/core/numeric.py
   branches/maskedarray/numpy/core/records.py
   branches/maskedarray/numpy/core/setup.py
   branches/maskedarray/numpy/core/src/arraytypes.inc.src
   branches/maskedarray/numpy/core/src/multiarraymodule.c
   branches/maskedarray/numpy/core/src/umathmodule.c.src
   branches/maskedarray/numpy/core/tests/test_regression.py
   branches/maskedarray/numpy/distutils/command/build.py
   branches/maskedarray/numpy/distutils/command/config.py
   branches/maskedarray/numpy/distutils/core.py
   branches/maskedarray/numpy/distutils/misc_util.py
   branches/maskedarray/numpy/doc/example.py
   branches/maskedarray/numpy/f2py/crackfortran.py
   branches/maskedarray/numpy/lib/arraysetops.py
   branches/maskedarray/numpy/lib/format.py
   branches/maskedarray/numpy/lib/io.py
   branches/maskedarray/numpy/lib/scimath.py
   branches/maskedarray/numpy/lib/tests/test_format.py
   branches/maskedarray/numpy/lib/utils.py
   branches/maskedarray/numpy/linalg/linalg.py
Log:
Merge maskedarray branch up to r4776.



Property changes on: branches/maskedarray
___________________________________________________________________
Name: svnmerge-integrated
   - /branches/build_with_scons:1-4676 /branches/cleanconfig_rtm:1-4610 /branches/distutils-revamp:1-2752 /branches/distutils_scons_command:1-4619 /branches/multicore:1-3687 /branches/numpy.scons:1-4484 /trunk:1-2871
   + /branches/build_with_scons:1-4676 /branches/cleanconfig_rtm:1-4677 /branches/distutils-revamp:1-2752 /branches/distutils_scons_command:1-4619 /branches/multicore:1-3687 /branches/numpy.scons:1-4484 /trunk:1-2871


Modified: branches/maskedarray/benchmarks/simpleindex.py
===================================================================
--- branches/maskedarray/benchmarks/simpleindex.py	2008-02-08 20:20:55 UTC (rev 4776)
+++ branches/maskedarray/benchmarks/simpleindex.py	2008-02-09 00:45:11 UTC (rev 4777)
@@ -46,4 +46,3 @@
 print "Numarray: ", numarray_timer.repeat(3,100)
 print "Python: ", python_timer.repeat(3,100)
 print "Optimized: ", numpy_timer3.repeat(3,100)
-

Modified: branches/maskedarray/numpy/_import_tools.py
===================================================================
--- branches/maskedarray/numpy/_import_tools.py	2008-02-08 20:20:55 UTC (rev 4776)
+++ branches/maskedarray/numpy/_import_tools.py	2008-02-09 00:45:11 UTC (rev 4777)
@@ -152,10 +152,10 @@
 
        Parameters
        ----------
-        *packges : arg-tuple 
+        *packges : arg-tuple
              the names (one or more strings) of all the modules one
              wishes to load into the top-level namespace.
-        verbose= : integer 
+        verbose= : integer
              verbosity level [default: -1].
              verbose=-1 will suspend also warnings.
         force= : bool

Modified: branches/maskedarray/numpy/add_newdocs.py
===================================================================
--- branches/maskedarray/numpy/add_newdocs.py	2008-02-08 20:20:55 UTC (rev 4776)
+++ branches/maskedarray/numpy/add_newdocs.py	2008-02-09 00:45:11 UTC (rev 4777)
@@ -1,7 +1,7 @@
 # This is only meant to add docs to
 #  objects defined in C-extension modules.
 # The purpose is to allow easier editing of the
-#  docstrings without requiring a re-compile. 
+#  docstrings without requiring a re-compile.
 from lib import add_newdoc
 
 add_newdoc('numpy.core','dtype',
@@ -216,6 +216,7 @@
     size is determined by the size of string.  If sep is not empty then the
     string is interpreted in ASCII mode and converted to the desired number type
     using sep as the separator between elements (extra whitespace is ignored).
+    ASCII integer conversions are base-10; octal and hex are not supported.
 
     """)
 
@@ -237,7 +238,7 @@
         open file object or string containing file name.
     dtype : data-type
         data type of the returned array
-    count : int 
+    count : int
         number of items to read (-1 mean 'all')
     sep : string
         separater between items if file is a text file (default "")
@@ -1106,8 +1107,8 @@
     is done if the array is not of float type and 'decimals' is >= 0.
 
     The keyword 'out' may be used to specify a different array to hold the
-    result rather than the default new array. If the type of the array 
-    specified by 'out' differs from that of 'a', the result is cast to the 
+    result rather than the default new array. If the type of the array
+    specified by 'out' differs from that of 'a', the result is cast to the
     new type, otherwise the original type is kept. Floats round to floats
     by default.
 
@@ -1208,7 +1209,7 @@
     |'heapsort' |   3   | O(n*log(n)) |     0      |   no  |
     |------------------------------------------------------|
 
-    All the sort algorithms make temporary copies of the data when the sort is 
+    All the sort algorithms make temporary copies of the data when the sort is
     not along the last axis. Consequently, sorts along the last axis are faster
     and use less space than sorts along other axis.
     """))

Copied: branches/maskedarray/numpy/core/SConstruct (from rev 4776, trunk/numpy/core/SConstruct)

Copied: branches/maskedarray/numpy/core/code_generators/__init__.py (from rev 4776, trunk/numpy/core/code_generators/__init__.py)

Modified: branches/maskedarray/numpy/core/code_generators/generate_array_api.py
===================================================================
--- branches/maskedarray/numpy/core/code_generators/generate_array_api.py	2008-02-08 20:20:55 UTC (rev 4776)
+++ branches/maskedarray/numpy/core/code_generators/generate_array_api.py	2008-02-09 00:45:11 UTC (rev 4777)
@@ -1,9 +1,6 @@
 import os
 import genapi
 
-OBJECT_API_ORDER = 'array_api_order.txt'
-MULTIARRAY_API_ORDER = 'multiarray_api_order.txt'
-
 types = ['Generic','Number','Integer','SignedInteger','UnsignedInteger',
          'Inexact',
          'Floating', 'ComplexFloating', 'Flexible', 'Character',
@@ -122,22 +119,30 @@
 """
 
 def generate_api(output_dir, force=False):
-    header_file = os.path.join(output_dir, '__multiarray_api.h')
-    c_file = os.path.join(output_dir,'__multiarray_api.c')
-    doc_file = os.path.join(output_dir, 'multiarray_api.txt')
+    basename = 'multiarray_api'
 
-    targets = (header_file, c_file, doc_file)
-    if (not force
-            and not genapi.should_rebuild(targets,
-                                          [OBJECT_API_ORDER,
-                                           MULTIARRAY_API_ORDER,
-                                           __file__])):
+    h_file = os.path.join(output_dir, '__%s.h' % basename)
+    c_file = os.path.join(output_dir, '__%s.c' % basename)
+    d_file = os.path.join(output_dir, '%s.txt' % basename)
+    targets = (h_file, c_file, d_file)
+    sources = ['array_api_order.txt',  'multiarray_api_order.txt']
+
+    if (not force and not genapi.should_rebuild(targets, sources + [__file__])):
         return targets
+    else:
+        do_generate_api(targets, sources)
 
+    return targets
+
+def do_generate_api(targets, sources):
+    header_file = targets[0]
+    c_file = targets[1]
+    doc_file = targets[2]
+
     objectapi_list = genapi.get_api_functions('OBJECT_API',
-                                              OBJECT_API_ORDER)
+                                              sources[0])
     multiapi_list = genapi.get_api_functions('MULTIARRAY_API',
-                                             MULTIARRAY_API_ORDER)
+                                             sources[1])
     # API fixes for __arrayobject_api.h
 
     fixed = 10

Modified: branches/maskedarray/numpy/core/code_generators/generate_ufunc_api.py
===================================================================
--- branches/maskedarray/numpy/core/code_generators/generate_ufunc_api.py	2008-02-08 20:20:55 UTC (rev 4776)
+++ branches/maskedarray/numpy/core/code_generators/generate_ufunc_api.py	2008-02-09 00:45:11 UTC (rev 4777)
@@ -1,8 +1,6 @@
 import os
 import genapi
 
-UFUNC_API_ORDER = 'ufunc_api_order.txt'
-
 h_template = r"""
 #ifdef _UMATHMODULE
 
@@ -72,18 +70,29 @@
 """
 
 def generate_api(output_dir, force=False):
-    header_file = os.path.join(output_dir, '__ufunc_api.h')
-    c_file = os.path.join(output_dir, '__ufunc_api.c')
-    doc_file = os.path.join(output_dir, 'ufunc_api.txt')
+    basename = 'ufunc_api'
 
-    targets = (header_file, c_file, doc_file)
-    if (not force
-            and not genapi.should_rebuild(targets,
-                                          [UFUNC_API_ORDER, __file__])):
+    h_file = os.path.join(output_dir, '__%s.h' % basename)
+    c_file = os.path.join(output_dir, '__%s.c' % basename)
+    d_file = os.path.join(output_dir, '%s.txt' % basename)
+    targets = (h_file, c_file, d_file)
+
+    sources = ['ufunc_api_order.txt']
+
+    if (not force and not genapi.should_rebuild(targets, sources + [__file__])):
         return targets
+    else:
+        do_generate_api(targets, sources)
 
-    ufunc_api_list = genapi.get_api_functions('UFUNC_API', UFUNC_API_ORDER)
+    return targets
 
+def do_generate_api(targets, sources):
+    header_file = targets[0]
+    c_file = targets[1]
+    doc_file = targets[2]
+
+    ufunc_api_list = genapi.get_api_functions('UFUNC_API', sources[0])
+
     # API fixes for __arrayobject_api.h
 
     fixed = 1

Modified: branches/maskedarray/numpy/core/defmatrix.py
===================================================================
--- branches/maskedarray/numpy/core/defmatrix.py	2008-02-08 20:20:55 UTC (rev 4776)
+++ branches/maskedarray/numpy/core/defmatrix.py	2008-02-09 00:45:11 UTC (rev 4777)
@@ -51,16 +51,16 @@
 class matrix(N.ndarray):
     """mat = matrix(data, dtype=None, copy=True)
 
-    Returns a matrix from an array-like object, or a string of 
+    Returns a matrix from an array-like object, or a string of
     data.  A matrix is a specialized 2-d array that retains
     it's 2-d nature through operations and where '*' means matrix
-    multiplication and '**' means matrix power. 
+    multiplication and '**' means matrix power.
 
     Parameters
     ----------
     data : array-like or string
-       If data is a string, then interpret the string as a matrix 
-         with commas or spaces separating columns and semicolons 
+       If data is a string, then interpret the string as a matrix
+         with commas or spaces separating columns and semicolons
          separating rows.
        If data is array-like than convert the array to a matrix.
     dtype : data-type
@@ -273,7 +273,7 @@
         the flattened array by default, otherwise over the specified axis.
 
         Parameters
-        ----------        
+        ----------
         axis : integer
             Axis along which the means are computed. The default is
             to compute the standard deviation of the flattened array.
@@ -289,7 +289,7 @@
             cast if necessary.
 
         Returns
-        -------        
+        -------
         mean : The return type varies, see above.
             A new array holding the result is returned unless out is
             specified, in which case a reference to out is returned.
@@ -342,7 +342,7 @@
         mean : average
 
         Notes
-        ----- 
+        -----
         The standard deviation is the square root of the
         average of the squared deviations from the mean, i.e. var =
         sqrt(mean((x - x.mean())**2)).  The computed standard
@@ -362,7 +362,7 @@
         ----------
         axis : integer
             Axis along which the variance is computed. The default is to
-            compute the variance of the flattened array.            
+            compute the variance of the flattened array.
         dtype : data-type
             Type to use in computing the variance. For arrays of integer
             type the default is float32, for arrays of float types it is

Modified: branches/maskedarray/numpy/core/include/numpy/ndarrayobject.h
===================================================================
--- branches/maskedarray/numpy/core/include/numpy/ndarrayobject.h	2008-02-08 20:20:55 UTC (rev 4776)
+++ branches/maskedarray/numpy/core/include/numpy/ndarrayobject.h	2008-02-09 00:45:11 UTC (rev 4777)
@@ -13,8 +13,15 @@
        everything when you're typing */
 #endif
 /* This is auto-generated by the installer */
-#include "config.h"
+#include "numpyconfig.h"
 
+/* Only use thread if configured in config and python supports it */
+#if defined WITH_THREAD && !NPY_NO_SMP
+        #define NPY_ALLOW_THREADS 1
+#else
+        #define NPY_ALLOW_THREADS 0
+#endif
+
 /* There are several places in the code where an array of dimensions is
  * allocated statically.  This is the size of that static allocation.
  *
@@ -80,7 +87,8 @@
 #define NPY_FALSE 0
 #define NPY_TRUE 1
 
-#if SIZEOF_LONG_DOUBLE==SIZEOF_DOUBLE
+
+#if NPY_SIZEOF_LONGDOUBLE == NPY_SIZEOF_DOUBLE
         typedef double npy_longdouble;
         #define NPY_LONGDOUBLE_FMT "g"
 #else
@@ -279,22 +287,15 @@
 #define NPY_MAX_ULONG  ULONG_MAX
 
 
-#define NPY_SIZEOF_LONG SIZEOF_LONG
-#define NPY_SIZEOF_INT SIZEOF_INT
-#define NPY_SIZEOF_SHORT SIZEOF_SHORT
-#define NPY_SIZEOF_FLOAT SIZEOF_FLOAT
-#define NPY_SIZEOF_DOUBLE SIZEOF_DOUBLE
-#define NPY_SIZEOF_LONGDOUBLE SIZEOF_LONG_DOUBLE
-#define NPY_SIZEOF_LONGLONG SIZEOF_LONG_LONG
 #define NPY_BITSOF_BOOL (sizeof(npy_bool)*CHAR_BIT)
 #define NPY_BITSOF_CHAR CHAR_BIT
-#define NPY_BITSOF_SHORT (SIZEOF_SHORT*CHAR_BIT)
-#define NPY_BITSOF_INT (SIZEOF_INT*CHAR_BIT)
-#define NPY_BITSOF_LONG (SIZEOF_LONG*CHAR_BIT)
-#define NPY_BITSOF_LONGLONG (NPY_SIZEOF_LONGLONG*CHAR_BIT)
-#define NPY_BITSOF_FLOAT (SIZEOF_FLOAT*CHAR_BIT)
-#define NPY_BITSOF_DOUBLE (SIZEOF_DOUBLE*CHAR_BIT)
-#define NPY_BITSOF_LONGDOUBLE (NPY_SIZEOF_LONGDOUBLE*CHAR_BIT)
+#define NPY_BITSOF_SHORT (NPY_SIZEOF_SHORT * CHAR_BIT)
+#define NPY_BITSOF_INT (NPY_SIZEOF_INT * CHAR_BIT)
+#define NPY_BITSOF_LONG (NPY_SIZEOF_LONG * CHAR_BIT)
+#define NPY_BITSOF_LONGLONG (NPY_SIZEOF_LONGLONG * CHAR_BIT)
+#define NPY_BITSOF_FLOAT (NPY_SIZEOF_FLOAT * CHAR_BIT)
+#define NPY_BITSOF_DOUBLE (NPY_SIZEOF_DOUBLE * CHAR_BIT)
+#define NPY_BITSOF_LONGDOUBLE (NPY_SIZEOF_LONGDOUBLE * CHAR_BIT)
 
 #if NPY_BITSOF_LONG == 8
 #define NPY_INT8 NPY_LONG
@@ -918,8 +919,8 @@
  * platform.  Py_intptr_t, Py_uintptr_t are defined in pyport.h. */
 typedef Py_intptr_t npy_intp;
 typedef Py_uintptr_t npy_uintp;
-#define NPY_SIZEOF_INTP SIZEOF_PY_INTPTR_T
-#define NPY_SIZEOF_UINTP SIZEOF_PY_INTPTR_T
+#define NPY_SIZEOF_INTP NPY_SIZEOF_PY_INTPTR_T
+#define NPY_SIZEOF_UINTP NPY_SIZEOF_PY_INTPTR_T
 
 #ifdef constchar
 #undef constchar
@@ -940,7 +941,7 @@
 #define constchar char
 #endif
 
-#if SIZEOF_PY_INTPTR_T == SIZEOF_INT
+#if NPY_SIZEOF_PY_INTPTR_T == NPY_SIZEOF_INT
         #define NPY_INTP NPY_INT
         #define NPY_UINTP NPY_UINT
         #define PyIntpArrType_Type PyIntArrType_Type
@@ -949,7 +950,7 @@
         #define NPY_MIN_INTP NPY_MIN_INT
         #define NPY_MAX_UINTP NPY_MAX_UINT
         #define NPY_INTP_FMT "d"
-#elif SIZEOF_PY_INTPTR_T == SIZEOF_LONG
+#elif NPY_SIZEOF_PY_INTPTR_T == NPY_SIZEOF_LONG
         #define NPY_INTP NPY_LONG
         #define NPY_UINTP NPY_ULONG
         #define PyIntpArrType_Type PyLongArrType_Type
@@ -958,7 +959,7 @@
         #define NPY_MIN_INTP MIN_LONG
         #define NPY_MAX_UINTP NPY_MAX_ULONG
         #define NPY_INTP_FMT "ld"
-#elif defined(PY_LONG_LONG) && (SIZEOF_PY_INTPTR_T == SIZEOF_LONG_LONG)
+#elif defined(PY_LONG_LONG) && (NPY_SIZEOF_PY_INTPTR_T == NPY_SIZEOF_LONGLONG)
         #define NPY_INTP NPY_LONGLONG
         #define NPY_UINTP NPY_ULONGLONG
         #define PyIntpArrType_Type PyLongLongArrType_Type
@@ -1894,7 +1895,7 @@
 
 #define PyArray_REFCOUNT(obj) (((PyObject *)(obj))->ob_refcnt)
 #define NPY_REFCOUNT PyArray_REFCOUNT
-#define NPY_MAX_ELSIZE (2*SIZEOF_LONGDOUBLE)
+#define NPY_MAX_ELSIZE (2 * NPY_SIZEOF_LONGDOUBLE)
 
 #define PyArray_ContiguousFromAny(op, type, min_depth, max_depth)             \
         PyArray_FromAny(op, PyArray_DescrFromType(type), min_depth,           \

Copied: branches/maskedarray/numpy/core/include/numpy/numpyconfig.h.in (from rev 4776, trunk/numpy/core/include/numpy/numpyconfig.h.in)

Modified: branches/maskedarray/numpy/core/numeric.py
===================================================================
--- branches/maskedarray/numpy/core/numeric.py	2008-02-08 20:20:55 UTC (rev 4776)
+++ branches/maskedarray/numpy/core/numeric.py	2008-02-09 00:45:11 UTC (rev 4777)
@@ -149,7 +149,7 @@
 
 def require(a, dtype=None, requirements=None):
     """Return an ndarray of the provided type that satisfies requirements.
-    
+
     This function is useful to be sure that an array with the correct flags
     is returned for passing to compiled code (perhaps through ctypes).
 
@@ -160,7 +160,7 @@
      dtype : data-type
        The required data-type (None is the default data-type -- float64)
      requirements : list of strings
-       The requirements list can be any of the 
+       The requirements list can be any of the
        'ENSUREARRAY' ('E')  - ensure that  a base-class ndarray
        'F_CONTIGUOUS' ('F') - ensure a Fortran-contiguous array
        'C_CONTIGUOUS' ('C') - ensure a C-contiguous array
@@ -169,7 +169,7 @@
        'OWNDATA' ('O')      - ensure an array that owns its own data
 
        The returned array will be guaranteed to have the listed requirements
-       by making a copy if needed. 
+       by making a copy if needed.
     """
     if requirements is None:
         requirements = []
@@ -276,7 +276,7 @@
 try:
     # importing this changes the dot function for basic 4 types
     # to blas-optimized versions.
-    from _dotblas import dot, vdot, inner, alterdot, restoredot    
+    from _dotblas import dot, vdot, inner, alterdot, restoredot
 except ImportError:
     def alterdot():
         "Does Nothing"

Modified: branches/maskedarray/numpy/core/records.py
===================================================================
--- branches/maskedarray/numpy/core/records.py	2008-02-08 20:20:55 UTC (rev 4776)
+++ branches/maskedarray/numpy/core/records.py	2008-02-09 00:45:11 UTC (rev 4777)
@@ -45,9 +45,9 @@
 class format_parser:
     """Class to convert formats, names, titles description to a dtype
 
-    After constructing the format_parser object, the dtype attribute is 
+    After constructing the format_parser object, the dtype attribute is
       the converted data-type.
-    
+
     dtype = format_parser(formats, names, titles).dtype
 
     Parameters
@@ -59,18 +59,18 @@
         comma-separated field names --- 'col1, col2, col3'
         list or tuple of field names
     titles : sequence
-        sequence of title strings or unicode        
+        sequence of title strings or unicode
     aligned : bool
         align the fields by padding as the C-compiler would
-    byteorder : 
-        If specified, all the fields will be changed to the 
+    byteorder :
+        If specified, all the fields will be changed to the
         provided byteorder.  Otherwise, the default byteorder is
         used.
 
     Returns
     -------
     object
-        A Python object whose dtype attribute is a data-type. 
+        A Python object whose dtype attribute is a data-type.
     """
     def __init__(self, formats, names, titles, aligned=False, byteorder=None):
         self._parseFormats(formats, aligned)
@@ -227,9 +227,9 @@
         by the *formats*, *names*, *titles*, *aligned*, and *byteorder* keywords.
     buf : [buffer] or None
         If this is None, then a new array is created of the given shape and data-type
-        If this is an object exposing the buffer interface, then the array will 
-        use the memory from an existing buffer.  In this case, the *offset* and 
-        *strides* keywords can also be used. 
+        If this is an object exposing the buffer interface, then the array will
+        use the memory from an existing buffer.  In this case, the *offset* and
+        *strides* keywords can also be used.
 
     See Also
     --------

Copied: branches/maskedarray/numpy/core/scons_support.py (from rev 4776, trunk/numpy/core/scons_support.py)

Modified: branches/maskedarray/numpy/core/setup.py
===================================================================
--- branches/maskedarray/numpy/core/setup.py	2008-02-08 20:20:55 UTC (rev 4776)
+++ branches/maskedarray/numpy/core/setup.py	2008-02-09 00:45:11 UTC (rev 4777)
@@ -18,6 +18,36 @@
     ('rint', 'HAVE_RINT'),
     ]
 
+def is_npy_no_signal():
+    """Return True if the NPY_NO_SIGNAL symbol must be defined in configuration
+    header."""
+    return sys.platform == 'win32'
+
+def is_npy_no_smp():
+    """Return True if the NPY_NO_SMP symbol must be defined in public
+    header (when SMP support cannot be reliably enabled)."""
+    # Python 2.3 causes a segfault when
+    #  trying to re-acquire the thread-state
+    #  which is done in error-handling
+    #  ufunc code.  NPY_ALLOW_C_API and friends
+    #  cause the segfault. So, we disable threading
+    #  for now.
+    if sys.version[:5] < '2.4.2':
+        nosmp = 1
+    else:
+        # Perhaps a fancier check is in order here.
+        #  so that threads are only enabled if there
+        #  are actually multiple CPUS? -- but
+        #  threaded code can be nice even on a single
+        #  CPU so that long-calculating code doesn't
+        #  block.
+        try:
+            nosmp = os.environ['NPY_NOSMP']
+            nosmp = 1
+        except KeyError:
+            nosmp = 0
+    return nosmp == 1
+
 def configuration(parent_package='',top_path=None):
     from numpy.distutils.misc_util import Configuration,dot_join
     from numpy.distutils.system_info import get_info, default_lib_dirs
@@ -53,28 +83,7 @@
                 raise SystemError,"Failed to test configuration. "\
                       "See previous error messages for more information."
 
-                # Python 2.3 causes a segfault when
-                #  trying to re-acquire the thread-state
-                #  which is done in error-handling
-                #  ufunc code.  NPY_ALLOW_C_API and friends
-                #  cause the segfault. So, we disable threading
-                #  for now.
-            if sys.version[:5] < '2.4.2':
-                nosmp = 1
-            else:
-                # Perhaps a fancier check is in order here.
-                #  so that threads are only enabled if there
-                #  are actually multiple CPUS? -- but
-                #  threaded code can be nice even on a single
-                #  CPU so that long-calculating code doesn't
-                #  block.
-                try:
-                    nosmp = os.environ['NPY_NOSMP']
-                    nosmp = 1
-                except KeyError:
-                    nosmp = 0
-            if nosmp: moredefs = [('NPY_ALLOW_THREADS', '0')]
-            else: moredefs = []
+            moredefs = []
             #
             mathlibs = []
             tc = testcode_mathlib()
@@ -102,8 +111,8 @@
                 if check_func(func_name):
                     moredefs.append(defsymbol)
 
-            if sys.platform == 'win32':
-                moredefs.append('NPY_NO_SIGNAL')
+            if is_npy_no_signal():
+                moredefs.append('__NPY_PRIVATE_NO_SIGNAL')
 
             if sys.platform=='win32' or os.name=='nt':
                 from distutils.msvccompiler import get_build_architecture
@@ -123,8 +132,6 @@
                     target_f.write('#define %s\n' % (d))
                 else:
                     target_f.write('#define %s %s\n' % (d[0],d[1]))
-            if not nosmp:  # default is to use WITH_THREAD
-                target_f.write('#ifdef WITH_THREAD\n#define NPY_ALLOW_THREADS 1\n#else\n#define NPY_ALLOW_THREADS 0\n#endif\n')
             target_f.close()
             print 'File:',target
             target_f = open(target)
@@ -151,6 +158,40 @@
         config.add_data_files((header_dir,target))
         return target
 
+    def generate_numpyconfig_h(ext, build_dir):
+        """Depends on config.h: generate_config_h has to be called before !"""
+        target = join(build_dir,'numpyconfig.h')
+        if newer(__file__,target):
+            config_cmd = config.get_config_cmd()
+            log.info('Generating %s',target)
+            testcode = generate_numpyconfig_code(target)
+
+            from distutils import sysconfig
+            python_include = sysconfig.get_python_inc()
+            python_h = join(python_include, 'Python.h')
+            if not os.path.isfile(python_h):
+                raise SystemError,\
+                      "Non-existing %s. Perhaps you need to install"\
+                      " python-dev|python-devel." % (python_h)
+
+            config.numpy_include_dirs
+            result = config_cmd.try_run(testcode,
+                                include_dirs = [python_include] + \
+                                                       config.numpy_include_dirs,
+                                        library_dirs = default_lib_dirs)
+
+            if not result:
+                raise SystemError,"Failed to generate numpy configuration. "\
+                      "See previous error messages for more information."
+
+            print 'File: %s' % target
+            target_f = open(target)
+            print target_f.read()
+            target_f.close()
+            print 'EOF'
+        config.add_data_files((header_dir, target))
+        return target
+
     def generate_api_func(module_name):
         def generate_api(ext, build_dir):
             script = join(codegen_dir, module_name + '.py')
@@ -205,6 +246,7 @@
     config.add_extension('multiarray',
                          sources = [join('src','multiarraymodule.c'),
                                     generate_config_h,
+                                    generate_numpyconfig_h,
                                     generate_array_api,
                                     join('src','scalartypes.inc.src'),
                                     join('src','arraytypes.inc.src'),
@@ -216,6 +258,7 @@
 
     config.add_extension('umath',
                          sources = [generate_config_h,
+                                    generate_numpyconfig_h,
                                     join('src','umathmodule.c.src'),
                                     generate_umath_c,
                                     generate_ufunc_api,
@@ -231,6 +274,7 @@
     config.add_extension('_sort',
                          sources=[join('src','_sortmodule.c.src'),
                                   generate_config_h,
+                                  generate_numpyconfig_h,
                                   generate_array_api,
                                   ],
                          )
@@ -238,6 +282,7 @@
     config.add_extension('scalarmath',
                          sources=[join('src','scalarmathmodule.c.src'),
                                   generate_config_h,
+                                  generate_numpyconfig_h,
                                   generate_array_api,
                                   generate_ufunc_api],
                          )
@@ -342,6 +387,85 @@
     testcode = '\n'.join(testcode)
     return testcode
 
+def generate_numpyconfig_code(target):
+    """Return the source code as a string of the code to generate the
+    numpyconfig header file."""
+    if sys.platform == 'win32':
+        target = target.replace('\\','\\\\')
+    # Config symbols to prepend
+    prepends = [('NPY_SIZEOF_SHORT', 'SIZEOF_SHORT'),
+            ('NPY_SIZEOF_INT', 'SIZEOF_INT'),
+            ('NPY_SIZEOF_LONG', 'SIZEOF_LONG'),
+            ('NPY_SIZEOF_FLOAT', 'SIZEOF_FLOAT'),
+            ('NPY_SIZEOF_DOUBLE', 'SIZEOF_DOUBLE'),
+            ('NPY_SIZEOF_LONGDOUBLE', 'SIZEOF_LONG_DOUBLE'),
+            ('NPY_SIZEOF_PY_INTPTR_T', 'SIZEOF_PY_INTPTR_T')]
+
+    testcode = ["""
+#include <Python.h>
+#include "config.h"
+
+int main()
+{
+    FILE* f;
+
+    f = fopen("%s", "w");
+    if (f == NULL) {
+        return -1;
+    }
+""" % target]
+
+    testcode.append(r"""
+    fprintf(f, "/*\n * This file is generated by %s. DO NOT EDIT \n */\n");
+""" % __file__)
+
+    # Prepend NPY_ to any SIZEOF defines
+    testcode.extend([r'    fprintf(f, "#define ' + i + r' %%d \n", %s);' % j for i, j in prepends])
+
+    # Conditionally define NPY_NO_SIGNAL
+    if is_npy_no_signal():
+        testcode.append(r'    fprintf(f, "\n#define NPY_NO_SIGNAL\n");')
+
+    # Define NPY_NOSMP to 1 if explicitely requested, or if we cannot
+    # support thread support reliably
+    if is_npy_no_smp():
+        testcode.append(r'    fprintf(f, "#define NPY_NO_SMP 1\n");')
+    else:
+        testcode.append(r'    fprintf(f, "#define NPY_NO_SMP 0\n");')
+
+    tmpcode = r"""
+    #ifdef PY_LONG_LONG
+        fprintf(f, "\n#define %s %%d \n", %s);
+        fprintf(f, "#define %s %%d \n", %s);
+    #else
+        fprintf(f, "/* PY_LONG_LONG not defined  */ \n");
+    #endif"""
+    testcode.append(tmpcode % ('NPY_SIZEOF_LONGLONG', 'SIZEOF_LONG_LONG',
+                               'NPY_SIZEOF_PY_LONG_LONG', 'SIZEOF_PY_LONG_LONG'))
+
+    testcode.append(r"""
+#ifndef CHAR_BIT
+          {
+             unsigned char var = 2;
+             int i = 0;
+             while (var >= 2) {
+                     var = var << 1;
+                     i++;
+             }
+             fprintf(f,"#define CHAR_BIT %d\n", i+1);
+          }
+#else
+          fprintf(f, "/* #define CHAR_BIT %d */\n", CHAR_BIT);
+#endif""")
+
+    testcode.append("""
+    fclose(f);
+
+    return 0;
+}
+""")
+    return "\n".join(testcode)
+
 if __name__=='__main__':
     from numpy.distutils.core import setup
     setup(configuration=configuration)

Copied: branches/maskedarray/numpy/core/setupscons.py (from rev 4776, trunk/numpy/core/setupscons.py)

Modified: branches/maskedarray/numpy/core/src/arraytypes.inc.src
===================================================================
--- branches/maskedarray/numpy/core/src/arraytypes.inc.src	2008-02-08 20:20:55 UTC (rev 4776)
+++ branches/maskedarray/numpy/core/src/arraytypes.inc.src	2008-02-09 00:45:11 UTC (rev 4777)
@@ -1,4 +1,5 @@
 /* -*- c -*- */
+#include "config.h"
 
 static longlong
 MyPyLong_AsLongLong(PyObject *vv)
@@ -934,7 +935,7 @@
 {
         @btype@ result;
 
-        result = PyOS_strto@func@(str, endptr, 0);
+        result = PyOS_strto@func@(str, endptr, 10);
         *ip = (@type@) result;
         return 0;
 }

Modified: branches/maskedarray/numpy/core/src/multiarraymodule.c
===================================================================
--- branches/maskedarray/numpy/core/src/multiarraymodule.c	2008-02-08 20:20:55 UTC (rev 4776)
+++ branches/maskedarray/numpy/core/src/multiarraymodule.c	2008-02-09 00:45:11 UTC (rev 4777)
@@ -3065,23 +3065,25 @@
     PyArrayObject *ap1=NULL;
     PyArrayObject *ap2=NULL;
     PyArrayObject *ret=NULL;
-    int typenum = 0;
+    PyArray_Descr *dtype;
 
     NPY_BEGIN_THREADS_DEF
 
-        typenum = PyArray_ObjectType((PyObject *)op1, 0);
-    typenum = PyArray_ObjectType(op2, typenum);
+    dtype = PyArray_DescrFromObject((PyObject *)op2, op1->descr);
+    
+    /* need ap1 as contiguous array and of right type */
+    Py_INCREF(dtype);
+    ap1 = (PyArrayObject *)PyArray_FromAny((PyObject *)op1, dtype, 
+					   1, 1, NPY_DEFAULT, NULL);
 
-    /* need ap1 as contiguous array and of right type */
-    ap1 = (PyArrayObject *)PyArray_ContiguousFromAny((PyObject *)op1,
-                                                     typenum,
-                                                     1, 1);
-    if (ap1 == NULL)
+    if (ap1 == NULL) {
+        Py_DECREF(dtype);
         return NULL;
+    }
 
     /* need ap2 as contiguous array and of right type */
-    ap2 = (PyArrayObject *)PyArray_ContiguousFromAny(op2, typenum,
-                                                     0, 0);
+    ap2 = (PyArrayObject *)PyArray_FromAny(op2, dtype, 0, 0, NPY_DEFAULT, NULL);
+
     if (ap2 == NULL)
         goto fail;
 
@@ -7267,7 +7269,7 @@
 }
 
 
-#ifndef NPY_NO_SIGNAL
+#ifndef __NPY_PRIVATE_NO_SIGNAL
 
 SIGJMP_BUF _NPY_SIGINT_BUF;
 

Modified: branches/maskedarray/numpy/core/src/umathmodule.c.src
===================================================================
--- branches/maskedarray/numpy/core/src/umathmodule.c.src	2008-02-08 20:20:55 UTC (rev 4776)
+++ branches/maskedarray/numpy/core/src/umathmodule.c.src	2008-02-09 00:45:11 UTC (rev 4777)
@@ -5,6 +5,7 @@
 #define _UMATHMODULE
 #include "numpy/ufuncobject.h"
 #include "abstract.h"
+#include "config.h"
 #include <math.h>
 
 /* A whole slew of basic math functions are provided originally

Modified: branches/maskedarray/numpy/core/tests/test_regression.py
===================================================================
--- branches/maskedarray/numpy/core/tests/test_regression.py	2008-02-08 20:20:55 UTC (rev 4776)
+++ branches/maskedarray/numpy/core/tests/test_regression.py	2008-02-09 00:45:11 UTC (rev 4777)
@@ -771,5 +771,14 @@
     def check_binary_repr_0_width(self, level=rlevel):
         assert_equal(np.binary_repr(0,width=3),'000')
 
+    def check_fromstring(self, level=rlevel):
+        assert_equal(np.fromstring("12:09:09", dtype=int, sep=":"),
+                     [12,9,9])
+
+    def check_searchsorted_variable_length(self, level=rlevel):
+        x = np.array(['a','aa','b'])
+        y = np.array(['d','e'])
+        assert_equal(x.searchsorted(y), [3,3])
+
 if __name__ == "__main__":
     NumpyTest().run()

Modified: branches/maskedarray/numpy/distutils/command/build.py
===================================================================
--- branches/maskedarray/numpy/distutils/command/build.py	2008-02-08 20:20:55 UTC (rev 4776)
+++ branches/maskedarray/numpy/distutils/command/build.py	2008-02-09 00:45:11 UTC (rev 4777)
@@ -32,3 +32,9 @@
         if build_scripts is None:
             self.build_scripts = os.path.join(self.build_base,
                                               'scripts' + plat_specifier)
+
+    def run(self):
+        # Make sure that scons based extensions are complete.
+        self.run_command('scons')
+
+        old_build.run(self)

Modified: branches/maskedarray/numpy/distutils/command/config.py
===================================================================
--- branches/maskedarray/numpy/distutils/command/config.py	2008-02-08 20:20:55 UTC (rev 4776)
+++ branches/maskedarray/numpy/distutils/command/config.py	2008-02-09 00:45:11 UTC (rev 4777)
@@ -101,6 +101,21 @@
                                  (body, headers, include_dirs,
                                   libraries, library_dirs, lang))
 
+    def check_decl(self, symbol,
+                   headers=None, include_dirs=None):
+        self._check_compiler()
+        body = """
+int main()
+{
+#ifndef %s
+    (void) %s;
+#endif
+    ;
+    return 0;
+}""" % (symbol, symbol)
+
+        return self.try_compile(body, headers, include_dirs)
+
     def check_func(self, func,
                    headers=None, include_dirs=None,
                    libraries=None, library_dirs=None,

Copied: branches/maskedarray/numpy/distutils/command/scons.py (from rev 4776, trunk/numpy/distutils/command/scons.py)

Modified: branches/maskedarray/numpy/distutils/core.py
===================================================================
--- branches/maskedarray/numpy/distutils/core.py	2008-02-08 20:20:55 UTC (rev 4776)
+++ branches/maskedarray/numpy/distutils/core.py	2008-02-09 00:45:11 UTC (rev 4777)
@@ -21,9 +21,10 @@
 import distutils.dist
 
 from numpy.distutils.extension import Extension
+from numpy.distutils.numpy_distribution import NumpyDistribution
 from numpy.distutils.command import config, config_compiler, \
      build, build_py, build_ext, build_clib, build_src, build_scripts, \
-     sdist, install_data, install_headers, install, bdist_rpm
+     sdist, install_data, install_headers, install, bdist_rpm, scons
 from numpy.distutils.misc_util import get_data_files, is_sequence, is_string
 
 numpy_cmdclass = {'build':            build.build,
@@ -36,6 +37,7 @@
                   'build_py':         build_py.build_py,
                   'build_clib':       build_clib.build_clib,
                   'sdist':            sdist.sdist,
+                  'scons':            scons.scons,
                   'install_data':     install_data.install_data,
                   'install_headers':  install_headers.install_headers,
                   'install':          install.install,
@@ -95,9 +97,10 @@
     # class is local to a function in setuptools.command.easy_install
     if dist is not None and \
             'DistributionWithoutHelpCommands' in repr(dist):
+        raise NotImplementedError("setuptools not supported yet for numpy.scons branch")
         dist = None
     if always and dist is None:
-        dist = distutils.dist.Distribution()
+        dist = NumpyDistribution()
     return dist
 
 def _exit_interactive_session(_cache=[]):
@@ -175,6 +178,9 @@
        and 'headers' not in new_attr:
         new_attr['headers'] = []
 
+    # Use our custom NumpyDistribution class instead of distutils' one
+    new_attr['distclass'] = NumpyDistribution
+
     return old_setup(**new_attr)
 
 def _check_append_library(libraries, item):

Modified: branches/maskedarray/numpy/distutils/misc_util.py
===================================================================
--- branches/maskedarray/numpy/distutils/misc_util.py	2008-02-08 20:20:55 UTC (rev 4776)
+++ branches/maskedarray/numpy/distutils/misc_util.py	2008-02-09 00:45:11 UTC (rev 4777)
@@ -112,11 +112,11 @@
     return minrelpath(joined)
 
 def get_mathlibs(path=None):
-    """Return the MATHLIB line from config.h
+    """Return the MATHLIB line from numpyconfig.h
     """
     if path is None:
         path = os.path.join(get_numpy_include_dirs()[0], 'numpy')
-    config_file = os.path.join(path,'config.h')
+    config_file = os.path.join(path,'numpyconfig.h')
     fid = open(config_file)
     mathlibs = []
     s = '#define MATHLIB'
@@ -574,7 +574,7 @@
 class Configuration(object):
 
     _list_keys = ['packages', 'ext_modules', 'data_files', 'include_dirs',
-                  'libraries', 'headers', 'scripts', 'py_modules']
+                  'libraries', 'headers', 'scripts', 'py_modules', 'scons_data']
     _dict_keys = ['package_dir']
     _extra_keys = ['name', 'version']
 
@@ -586,6 +586,7 @@
                  top_path=None,
                  package_path=None,
                  caller_level=1,
+                 setup_name='setup.py',
                  **attrs):
         """Construct configuration instance of a package.
 
@@ -674,6 +675,8 @@
             if caller_instance.options['delegate_options_to_subpackages']:
                 self.set_options(**caller_instance.options)
 
+        self.setup_name = setup_name
+
     def todict(self):
         """Return configuration distionary suitable for passing
         to distutils.core.setup() function.
@@ -795,7 +798,7 @@
         else:
             subpackage_path = njoin([subpackage_path] + l[:-1])
             subpackage_path = self.paths([subpackage_path])[0]
-        setup_py = njoin(subpackage_path, 'setup.py')
+        setup_py = njoin(subpackage_path, self.setup_name)
         if not self.options['ignore_setup_xxx_py']:
             if not os.path.isfile(setup_py):
                 setup_py = njoin(subpackage_path,
@@ -1165,6 +1168,55 @@
             self.warn('distutils distribution has been initialized,'\
                       ' it may be too late to add a library '+ name)
 
+    def add_sconscript(self, sconscript, subpackage_path=None,
+                       standalone = False, pre_hook = None,
+                       post_hook = None, source_files = None):
+        """Add a sconscript to configuration.
+
+        pre_hook and post hook should be sequences of callable, which will be
+        use before and after executing scons. """
+        if standalone:
+            parent_name = None
+        else:
+            parent_name = self.name
+
+        dist = self.get_distribution()
+        # Convert the sconscript name to a relative filename (relative from top
+        # setup.py's directory)
+        fullsconsname = self.paths(sconscript)[0]
+
+        # XXX: Think about a way to automatically register source files from
+        # scons...
+        full_source_files = []
+        if source_files:
+            full_source_files.extend([self.paths(i)[0] for i in source_files])
+
+        if dist is not None:
+            dist.scons_data.append((fullsconsname,
+                                    pre_hook,
+                                    post_hook,
+                                    full_source_files,
+                                    parent_name))
+            self.warn('distutils distribution has been initialized,'\
+                      ' it may be too late to add a subpackage '+ subpackage_name)
+            # XXX: we add a fake extension, to correctly initialize some
+            # options in distutils command.
+            dist.add_extension('', sources = [])
+        else:
+            self.scons_data.append((fullsconsname,
+                                    pre_hook,
+                                    post_hook,
+                                    full_source_files,
+                                    parent_name))
+            # XXX: we add a fake extension, to correctly initialize some
+            # options in distutils command.
+            self.add_extension('', sources = [])
+
+    def add_configres(self):
+        from numscons import get_scons_configres_dir, get_scons_configres_filename
+        file = os.path.join(get_scons_configres_dir(), self.local_path,
+                            get_scons_configres_filename())
+
     def add_scripts(self,*files):
         """Add scripts to configuration.
         """
@@ -1394,6 +1446,12 @@
         """
         self.py_modules.append((self.name,name,generate_config_py))
 
+    def scons_make_config_py(self, name = '__config__'):
+        """Generate package __config__.py file containing system_info
+        information used during building the package.
+        """
+        self.py_modules.append((self.name, name, scons_generate_config_py))
+
     def get_info(self,*names):
         """Get resources information.
         """
@@ -1425,6 +1483,50 @@
     # else running numpy/core/setup.py
     return include_dirs
 
+def scons_generate_config_py(target):
+    """generate config.py file containing system_info information
+    used during building the package.
+
+    usage:
+        config['py_modules'].append((packagename, '__config__',generate_config_py))
+    """
+    from distutils.dir_util import mkpath
+    from numscons import get_scons_configres_dir, get_scons_configres_filename
+    d = {}
+    mkpath(os.path.dirname(target))
+    f = open(target, 'w')
+    f.write('# this file is generated by %s\n' % (os.path.abspath(sys.argv[0])))
+    f.write('# it contains system_info results at the time of building this package.\n')
+    f.write('__all__ = ["show"]\n\n')
+    confdir = get_scons_configres_dir()
+    confilename = get_scons_configres_filename()
+    for root, dirs, files in os.walk(confdir):
+        if files:
+            file = os.path.join(root, confilename)
+            assert root.startswith(confdir)
+            pkg_name = '.'.join(root[len(confdir)+1:].split(os.sep))
+            fid = open(file, 'r')
+            try:
+                cnt = fid.read()
+                d[pkg_name] = eval(cnt)
+            finally:
+                fid.close()
+    # d is a dictionary whose keys are package names, and values the
+    # corresponding configuration. Each configuration is itself a dictionary
+    # (lib : libinfo)
+    f.write('_config = %s\n' % d)
+    f.write(r'''
+def show():
+    for pkg, config in _config.items():
+        print "package %s configuration:" % pkg
+        for lib, libc in config.items():
+            print '    %s' % lib
+            for line in libc.split('\n'):
+                print '\t%s' % line
+    ''')
+    f.close()
+    return target
+
 #########################
 
 def default_config_dict(name = None, parent_name = None, local_path=None):

Copied: branches/maskedarray/numpy/distutils/numpy_distribution.py (from rev 4776, trunk/numpy/distutils/numpy_distribution.py)

Copied: branches/maskedarray/numpy/distutils/setupscons.py (from rev 4776, trunk/numpy/distutils/setupscons.py)

Modified: branches/maskedarray/numpy/doc/example.py
===================================================================
--- branches/maskedarray/numpy/doc/example.py	2008-02-08 20:20:55 UTC (rev 4776)
+++ branches/maskedarray/numpy/doc/example.py	2008-02-09 00:45:11 UTC (rev 4777)
@@ -53,7 +53,7 @@
         Explanation
 
     See Also
-    --------    
+    --------
     otherfunc : relationship (optional)
     newfunc : relationship (optional)
 

Modified: branches/maskedarray/numpy/f2py/crackfortran.py
===================================================================
--- branches/maskedarray/numpy/f2py/crackfortran.py	2008-02-08 20:20:55 UTC (rev 4776)
+++ branches/maskedarray/numpy/f2py/crackfortran.py	2008-02-09 00:45:11 UTC (rev 4777)
@@ -791,7 +791,7 @@
             grouplist[groupcounter]=[]
         if needinterface:
             if verbose>1:
-                outmess('analyzeline: Creating additional interface block.\n',0)
+                outmess('analyzeline: Creating additional interface block (groupcounter=%s).\n' % (groupcounter),0)
             groupname[groupcounter]='interface'
             groupcache[groupcounter]['block']='interface'
             groupcache[groupcounter]['name']='unknown_interface'
@@ -892,6 +892,7 @@
             pl = ch[0]
             outmess('analyzeline: cannot handle multiple attributes without type specification. Ignoring %r.\n' % (','.join(ch[1:])))
         last_name = None
+
         for e in [x.strip() for x in markoutercomma(ll).split('@,@')]:
             m1=namepattern.match(e)
             if not m1:
@@ -910,11 +911,14 @@
                 ap=m.group('this')+pl
                 if _intentcallbackpattern.match(ap):
                     if k not in groupcache[groupcounter]['args']:
-                        if groupcounter>1 and \
-                               '__user__' in groupcache[groupcounter-2]['name']:
+                        if groupcounter>1:
                             outmess('analyzeline: appending intent(callback) %s'\
                                     ' to %s arguments\n' % (k,groupcache[groupcounter]['name']))
+                            if '__user__' not in groupcache[groupcounter-2]['name']:
+                                outmess('analyzeline: missing __user__ module (could be nothing)\n')
                             groupcache[groupcounter]['args'].append(k)
+                        else:
+                            errmess('analyzeline: intent(callback) %s is ignored' % (k))
                     else:
                         errmess('analyzeline: intent(callback) %s is already'\
                                 ' in argument list' % (k))

Copied: branches/maskedarray/numpy/f2py/setupscons.py (from rev 4776, trunk/numpy/f2py/setupscons.py)

Copied: branches/maskedarray/numpy/fft/SConstruct (from rev 4776, trunk/numpy/fft/SConstruct)

Copied: branches/maskedarray/numpy/fft/setupscons.py (from rev 4776, trunk/numpy/fft/setupscons.py)

Copied: branches/maskedarray/numpy/lib/SConstruct (from rev 4776, trunk/numpy/lib/SConstruct)

Modified: branches/maskedarray/numpy/lib/arraysetops.py
===================================================================
--- branches/maskedarray/numpy/lib/arraysetops.py	2008-02-08 20:20:55 UTC (rev 4776)
+++ branches/maskedarray/numpy/lib/arraysetops.py	2008-02-09 00:45:11 UTC (rev 4777)
@@ -207,7 +207,7 @@
     b1 = nm.zeros( ar1.shape, dtype = nm.int8 )
     b2 = nm.ones( ar2.shape, dtype = nm.int8 )
     tt = nm.concatenate( (b1, b2) )
-        
+
     # We need this to be a stable sort, so always use 'mergesort' here. The
     # values from the first array should always come before the values from the
     # second array.

Modified: branches/maskedarray/numpy/lib/format.py
===================================================================
--- branches/maskedarray/numpy/lib/format.py	2008-02-08 20:20:55 UTC (rev 4776)
+++ branches/maskedarray/numpy/lib/format.py	2008-02-09 00:45:11 UTC (rev 4777)
@@ -227,7 +227,7 @@
         raise ValueError("Header does not contain the correct keys: %r" % (keys,))
 
     # Sanity-check the values.
-    if (not isinstance(d['shape'], tuple) or 
+    if (not isinstance(d['shape'], tuple) or
         not numpy.all([isinstance(x, int) for x in d['shape']])):
         raise ValueError("shape is not valid: %r" % (d['shape'],))
     if not isinstance(d['fortran_order'], bool):
@@ -407,6 +407,3 @@
         mode=mode, offset=offset)
 
     return marray
-
-
-

Modified: branches/maskedarray/numpy/lib/io.py
===================================================================
--- branches/maskedarray/numpy/lib/io.py	2008-02-08 20:20:55 UTC (rev 4776)
+++ branches/maskedarray/numpy/lib/io.py	2008-02-09 00:45:11 UTC (rev 4777)
@@ -19,8 +19,8 @@
 _file = file
 
 class BagObj(object):
-    """A simple class that converts attribute lookups to 
-    getitems on the class passed in. 
+    """A simple class that converts attribute lookups to
+    getitems on the class passed in.
     """
     def __init__(self, obj):
         self._obj = obj
@@ -31,8 +31,8 @@
             raise AttributeError, key
 
 class NpzFile(object):
-    """A dictionary-like object with lazy-loading of files in the zipped 
-    archive provided on construction. 
+    """A dictionary-like object with lazy-loading of files in the zipped
+    archive provided on construction.
 
     The arrays and file strings are lazily loaded on either
     getitem access using obj['key'] or attribute lookup using obj.f.key
@@ -54,13 +54,13 @@
 
     def __getitem__(self, key):
         # FIXME: This seems like it will copy strings around
-        #   more than is strictly necessary.  The zipfile 
+        #   more than is strictly necessary.  The zipfile
         #   will read the string and then
         #   the format.read_array will copy the string
-        #   to another place in memory. 
-        #   It would be better if the zipfile could read 
+        #   to another place in memory.
+        #   It would be better if the zipfile could read
         #   (or at least uncompress) the data
-        #   directly into the array memory. 
+        #   directly into the array memory.
         member = 0
         if key in self._files:
             member = 1
@@ -90,21 +90,21 @@
     memmap : bool
         If true, then memory-map the .npy file or unzip the .npz file into
            a temporary directory and memory-map each component
-        This has no effect for a pickle. 
+        This has no effect for a pickle.
 
     Returns
     -------
     result : array, tuple, dict, etc.
-        data stored in the file. 
+        data stored in the file.
         If file contains pickle data, then whatever is stored in the pickle is
           returned.
-        If the file is .npy file, then an array is returned.  
-        If the file is .npz file, then a dictionary-like object is returned 
+        If the file is .npy file, then an array is returned.
+        If the file is .npz file, then a dictionary-like object is returned
           which has a filename:array key:value pair for every file in the zip.
 
     Raises
     ------
-    IOError 
+    IOError
     """
     if isinstance(file, type("")):
         fid = _file(file,"rb")
@@ -124,7 +124,7 @@
     elif magic == format.MAGIC_PREFIX: # .npy file
         return format.read_array(fid)
     else:  # Try a pickle
-        try: 
+        try:
             return _cload(fid)
         except:
             raise IOError, \
@@ -133,8 +133,8 @@
 def save(file, arr):
     """Save an array to a binary file (a string or file-like object).
 
-    If the file is a string, then if it does not have the .npy extension, 
-        it is appended and a file open. 
+    If the file is a string, then if it does not have the .npy extension,
+        it is appended and a file open.
 
     Data is saved to the open file in NumPy-array format
 
@@ -144,7 +144,7 @@
     ...
     np.save('myfile', a)
     a = np.load('myfile.npy')
-    """    
+    """
     if isinstance(file, str):
         if not file.endswith('.npy'):
             file = file + '.npy'
@@ -158,15 +158,15 @@
 def savez(file, *args, **kwds):
     """Save several arrays into an .npz file format which is a zipped-archive
     of arrays
-    
-    If keyword arguments are given, then filenames are taken from the keywords. 
-    If arguments are passed in with no keywords, then stored file names are 
-    arr_0, arr_1, etc.  
+
+    If keyword arguments are given, then filenames are taken from the keywords.
+    If arguments are passed in with no keywords, then stored file names are
+    arr_0, arr_1, etc.
     """
 
     if isinstance(file, str):
         if not file.endswith('.npz'):
-            file = file + '.npz'        
+            file = file + '.npz'
 
     namedict = kwds
     for i, val in enumerate(args):
@@ -190,7 +190,7 @@
         format.write_array(fid, np.asanyarray(val))
         fid.close()
         zip.write(filename, arcname=fname)
-        
+
     zip.close()
     for name in todel:
         os.remove(name)
@@ -359,7 +359,3 @@
 
     if origShape is not None:
         X.shape = origShape
-
-
-
-

Modified: branches/maskedarray/numpy/lib/scimath.py
===================================================================
--- branches/maskedarray/numpy/lib/scimath.py	2008-02-08 20:20:55 UTC (rev 4776)
+++ branches/maskedarray/numpy/lib/scimath.py	2008-02-09 00:45:11 UTC (rev 4777)
@@ -93,7 +93,7 @@
     """Convert `x` to complex if it has real, negative components.
 
     Otherwise, output is just the array version of the input (via asarray).
-    
+
     Parameters
     ----------
     x : array_like
@@ -119,7 +119,7 @@
     """Convert `x` to double if it has real, negative components.
 
     Otherwise, output is just the array version of the input (via asarray).
-    
+
     Parameters
     ----------
     x : array_like
@@ -145,7 +145,7 @@
     """Convert `x` to complex if it has real components x_i with abs(x_i)>1.
 
     Otherwise, output is just the array version of the input (via asarray).
-    
+
     Parameters
     ----------
     x : array_like
@@ -203,7 +203,7 @@
 
     If x contains negative inputs, the answer is computed and returned in the
     complex domain.
-    
+
     Parameters
     ----------
     x : array_like
@@ -221,7 +221,7 @@
 
     Negative arguments are correctly handled (recall that for negative
     arguments, the identity exp(log(z))==z does not hold anymore):
-    
+
     >>> log(-math.exp(1)) == (1+1j*math.pi)
     True
     """
@@ -233,7 +233,7 @@
 
     If x contains negative inputs, the answer is computed and returned in the
     complex domain.
-    
+
     Parameters
     ----------
     x : array_like
@@ -263,7 +263,7 @@
 
     If x contains negative inputs, the answer is computed and returned in the
     complex domain.
-    
+
     Parameters
     ----------
     x : array_like
@@ -293,7 +293,7 @@
 
     If x contains negative inputs, the answer is computed and returned in the
     complex domain.
-    
+
     Parameters
     ----------
     x : array_like
@@ -307,7 +307,7 @@
 
     (We set the printing precision so the example can be auto-tested)
     >>> import numpy as np; np.set_printoptions(precision=4)
-    
+
     >>> log2([4,8])
     array([ 2.,  3.])
 
@@ -323,7 +323,7 @@
     If x contains negative values, it is converted to the complex domain.
 
     If p contains negative values, it is converted to floating point.
-    
+
     Parameters
     ----------
     x : array_like
@@ -332,7 +332,7 @@
     Returns
     -------
     array_like
-    
+
     Examples
     --------
     (We set the printing precision so the example can be auto-tested)
@@ -357,7 +357,7 @@
     For real x with abs(x)<=1, this returns the principal value.
 
     If abs(x)>1, the complex arccos() is computed.
-    
+
     Parameters
     ----------
     x : array_like
@@ -385,7 +385,7 @@
     For real x with abs(x)<=1, this returns the principal value.
 
     If abs(x)>1, the complex arcsin() is computed.
-    
+
     Parameters
     ----------
     x : array_like
@@ -414,7 +414,7 @@
     For real x with abs(x)<=1, this returns the principal value.
 
     If abs(x)>1, the complex arctanh() is computed.
-    
+
     Parameters
     ----------
     x : array_like

Copied: branches/maskedarray/numpy/lib/setupscons.py (from rev 4776, trunk/numpy/lib/setupscons.py)

Modified: branches/maskedarray/numpy/lib/tests/test_format.py
===================================================================
--- branches/maskedarray/numpy/lib/tests/test_format.py	2008-02-08 20:20:55 UTC (rev 4776)
+++ branches/maskedarray/numpy/lib/tests/test_format.py	2008-02-09 00:45:11 UTC (rev 4777)
@@ -21,9 +21,9 @@
     ...     np.complex128,
     ...     object,
     ... ]
-    >>> 
+    >>>
     >>> basic_arrays = []
-    >>> 
+    >>>
     >>> for scalar in scalars:
     ...     for endian in '<>':
     ...         dtype = np.dtype(scalar).newbyteorder(endian)
@@ -36,20 +36,20 @@
     ...             basic.reshape((3,5)).T,
     ...             basic.reshape((3,5))[::-1,::2],
     ...         ])
-    ... 
-    >>> 
+    ...
+    >>>
     >>> Pdescr = [
     ...     ('x', 'i4', (2,)),
     ...     ('y', 'f8', (2, 2)),
     ...     ('z', 'u1')]
-    >>> 
-    >>> 
+    >>>
+    >>>
     >>> PbufferT = [
     ...     ([3,2], [[6.,4.],[6.,4.]], 8),
     ...     ([4,3], [[7.,5.],[7.,5.]], 9),
     ...     ]
-    >>> 
-    >>> 
+    >>>
+    >>>
     >>> Ndescr = [
     ...     ('x', 'i4', (2,)),
     ...     ('Info', [
@@ -68,14 +68,14 @@
     ...         ('Value', 'c16')]),
     ...     ('y', 'f8', (2, 2)),
     ...     ('z', 'u1')]
-    >>> 
-    >>> 
+    >>>
+    >>>
     >>> NbufferT = [
     ...     ([3,2], (6j, 6., ('nn', [6j,4j], [6.,4.], [1,2]), 'NN', True), 'cc', ('NN', 6j), [[6.,4.],[6.,4.]], 8),
     ...     ([4,3], (7j, 7., ('oo', [7j,5j], [7.,5.], [2,1]), 'OO', False), 'dd', ('OO', 7j), [[7.,5.],[7.,5.]], 9),
     ...     ]
-    >>> 
-    >>> 
+    >>>
+    >>>
     >>> record_arrays = [
     ...     np.array(PbufferT, dtype=np.dtype(Pdescr).newbyteorder('<')),
     ...     np.array(NbufferT, dtype=np.dtype(Ndescr).newbyteorder('<')),
@@ -111,7 +111,7 @@
     ...     f = StringIO()
     ...     format.write_array_header_1_0(f, arr)
     ...     print repr(f.getvalue())
-    ... 
+    ...
     "F\x00{'descr': '|u1', 'fortran_order': False, 'shape': (0,)}              \n"
     "F\x00{'descr': '|u1', 'fortran_order': False, 'shape': ()}                \n"
     "F\x00{'descr': '|u1', 'fortran_order': False, 'shape': (15,)}             \n"
@@ -506,5 +506,3 @@
     for magic in bad_version_magic + malformed_magic:
         f = StringIO(magic)
         yield raises(ValueError)(format.read_array), f
-
-

Modified: branches/maskedarray/numpy/lib/utils.py
===================================================================
--- branches/maskedarray/numpy/lib/utils.py	2008-02-08 20:20:55 UTC (rev 4776)
+++ branches/maskedarray/numpy/lib/utils.py	2008-02-09 00:45:11 UTC (rev 4777)
@@ -106,7 +106,7 @@
     else:
         str1 = "%s is deprecated, use %s" % (oldname, newname),
         depdoc = '%s is DEPRECATED!! -- use %s instead' % (oldname, newname,)
-        
+
     def newfunc(*args,**kwds):
         warnings.warn(str1, DeprecationWarning)
         return func(*args, **kwds)
@@ -487,28 +487,28 @@
 #   * raise SyntaxError instead of a custom exception.
 
 class SafeEval(object):
-    
+
     def visit(self, node, **kw):
         cls = node.__class__
         meth = getattr(self,'visit'+cls.__name__,self.default)
         return meth(node, **kw)
-            
+
     def default(self, node, **kw):
         raise SyntaxError("Unsupported source construct: %s" % node.__class__)
-            
+
     def visitExpression(self, node, **kw):
         for child in node.getChildNodes():
             return self.visit(child, **kw)
-    
+
     def visitConst(self, node, **kw):
         return node.value
 
     def visitDict(self, node,**kw):
         return dict([(self.visit(k),self.visit(v)) for k,v in node.items])
-        
+
     def visitTuple(self, node, **kw):
         return tuple([self.visit(i) for i in node.nodes])
-        
+
     def visitList(self, node, **kw):
         return [self.visit(i) for i in node.nodes]
 
@@ -578,5 +578,3 @@
         raise
 
 #-----------------------------------------------------------------------------
-
-

Copied: branches/maskedarray/numpy/linalg/SConstruct (from rev 4776, trunk/numpy/linalg/SConstruct)

Modified: branches/maskedarray/numpy/linalg/linalg.py
===================================================================
--- branches/maskedarray/numpy/linalg/linalg.py	2008-02-08 20:20:55 UTC (rev 4776)
+++ branches/maskedarray/numpy/linalg/linalg.py	2008-02-09 00:45:11 UTC (rev 4777)
@@ -138,11 +138,11 @@
 
 def tensorsolve(a, b, axes=None):
     """Solve the tensor equation a x = b for x
-    
+
     It is assumed that all indices of x are summed over in the product,
     together with the rightmost indices of a, similarly as in
     tensordot(a, x, axes=len(b.shape)).
-    
+
     Parameters
     ----------
     a : array, shape b.shape+Q
@@ -153,11 +153,11 @@
     axes : tuple of integers
         Axes in a to reorder to the right, before inversion.
         If None (default), no reordering is done.
-    
+
     Returns
     -------
     x : array, shape Q
-    
+
     Examples
     --------
     >>> from numpy import *
@@ -169,7 +169,7 @@
     (2, 3, 4)
     >>> allclose(tensordot(a, x, axes=3), b)
     True
-    
+
     """
     a = asarray(a)
     b = asarray(b)
@@ -206,7 +206,7 @@
     x : array, shape (M,)
 
     Raises LinAlgError if a is singular or not square
-    
+
     """
     one_eq = len(b.shape) == 1
     if one_eq:
@@ -239,10 +239,10 @@
 
     The result is an inverse corresponding to the operation
     tensordot(a, b, ind), ie.,
-    
+
         x == tensordot(tensordot(tensorinv(a), a, ind), x, ind)
           == tensordot(tensordot(a, tensorinv(a), ind), x, ind)
-    
+
     for all x (up to floating-point accuracy).
 
     Parameters
@@ -298,12 +298,12 @@
 
 def inv(a):
     """Compute the inverse of a matrix.
-    
+
     Parameters
     ----------
     a : array-like, shape (M, M)
         Matrix to be inverted
-    
+
     Returns
     -------
     ainv : array-like, shape (M, M)
@@ -330,20 +330,20 @@
 
 def cholesky(a):
     """Compute the Cholesky decomposition of a matrix.
-    
+
     Returns the Cholesky decomposition, :lm:`A = L L^*` of a Hermitian
     positive-definite matrix :lm:`A`.
-    
+
     Parameters
     ----------
     a : array, shape (M, M)
         Matrix to be decomposed
-    
+
     Returns
     -------
     L : array, shape (M, M)
         Lower-triangular Cholesky factor of A
-    
+
     Raises LinAlgError if decomposition fails
 
     Examples
@@ -357,7 +357,7 @@
     >>> dot(L, L.T.conj())
     array([[ 1.+0.j,  0.-2.j],
            [ 0.+2.j,  5.+0.j]])
-    
+
     """
     _assertRank2(a)
     _assertSquareness(a)
@@ -400,7 +400,7 @@
     Q : double or complex array, shape (M, K)
     R : double or complex array, shape (K, N)
         Size K = min(M, N)
-    
+
     mode = 'r'
     R : double or complex array, shape (K, N)
 
@@ -429,7 +429,7 @@
     True
     >>> allclose(r, triu(r3[:6,:6], k=0))
     True
-    
+
     """
     _assertRank2(a)
     m, n = a.shape
@@ -507,7 +507,7 @@
 
 def eigvals(a):
     """Compute the eigenvalues of a general matrix.
-    
+
     Parameters
     ----------
     a : array, shape (M, M)
@@ -520,7 +520,7 @@
         The eigenvalues, each repeated according to its multiplicity.
         They are not necessarily ordered, nor are they necessarily
         real for real matrices.
-    
+
     Raises LinAlgError if eigenvalue computation does not converge
 
     See Also
@@ -534,7 +534,7 @@
     This is a simple interface to the LAPACK routines dgeev and zgeev
     that sets the flags to return only the eigenvalues of general real
     and complex arrays respectively.
-    
+
     The number w is an eigenvalue of a if there exists a vector v
     satisfying the equation dot(a,v) = w*v. Alternately, if w is a root of
     the characteristic equation det(a - w[i]*I) = 0, where det is the
@@ -586,7 +586,7 @@
 
 def eigvalsh(a, UPLO='L'):
     """Compute the eigenvalues of a Hermitean or real symmetric matrix.
-    
+
     Parameters
     ----------
     a : array, shape (M, M)
@@ -596,7 +596,7 @@
         Specifies whether the pertinent array data is taken from the upper
         or lower triangular part of a. Possible values are 'L', and 'U' for
         upper and lower respectively. Default is 'L'.
-    
+
     Returns
     -------
     w : double array, shape (M,)
@@ -616,7 +616,7 @@
     This is a simple interface to the LAPACK routines dsyevd and
     zheevd that sets the flags to return only the eigenvalues of real
     symmetric and complex Hermetian arrays respectively.
-    
+
     The number w is an eigenvalue of a if there exists a vector v
     satisfying the equation dot(a,v) = w*v. Alternately, if w is a root of
     the characteristic equation det(a - w[i]*I) = 0, where det is the
@@ -714,10 +714,10 @@
     that fact. If the eigenvalues are all different, then theoretically the
     eigenvectors are independent. Likewise, the matrix of eigenvectors is
     unitary if the matrix a is normal, i.e., if dot(a, a.H) = dot(a.H, a).
-    
+
     The left and right eigenvectors are not necessarily the (Hermitian)
     transposes of each other.
-    
+
     """
     a, wrap = _makearray(a)
     _assertRank2(a)
@@ -775,7 +775,7 @@
 
 def eigh(a, UPLO='L'):
     """Compute eigenvalues for a Hermitian or real symmetric matrix.
-    
+
     Parameters
     ----------
     a : array, shape (M, M)
@@ -785,7 +785,7 @@
         Specifies whether the pertinent array date is taken from the upper
         or lower triangular part of a. Possible values are 'L', and 'U'.
         Default is 'L'.
-    
+
     Returns
     -------
     w : double array, shape (M,)
@@ -793,7 +793,7 @@
     v : double or complex double array, shape (M, M)
         The normalized eigenvector corresponding to the eigenvalue w[i] is
         the column v[:,i].
-    
+
     Raises LinAlgError if eigenvalue computation does not converge
 
     See Also
@@ -801,13 +801,13 @@
     eigvalsh : eigenvalues of symmetric or Hemitiean arrays.
     eig : eigenvalues and right eigenvectors for non-symmetric arrays
     eigvals : eigenvalues of non-symmetric array.
-    
+
     Notes
     -----
     A simple interface to the LAPACK routines dsyevd and zheevd that compute
     the eigenvalues and eigenvectors of real symmetric and complex Hermitian
     arrays respectively.
-    
+
     The number w is an eigenvalue of a if there exists a vector v
     satisfying the equation dot(a,v) = w*v. Alternately, if w is a root of
     the characteristic equation det(a - w[i]*I) = 0, where det is the
@@ -866,7 +866,7 @@
     an 1d-array s of singular values (real, non-negative) such that
     a == U S Vh  if S is an suitably shaped matrix of zeros whose
     main diagonal is s.
-    
+
     Parameters
     ----------
     a : array, shape (M, N)
@@ -876,7 +876,7 @@
         If false, the shapes are    (M,K), (K,N) where K = min(M,N)
     compute_uv : boolean
         Whether to compute also U, Vh in addition to s
-    
+
     Returns
     -------
     U:  array, shape (M,M) or (M,K) depending on full_matrices
@@ -884,7 +884,7 @@
         The singular values, sorted so that s[i] >= s[i+1]
         K = min(M, N)
     Vh: array, shape (N,N) or (K,N) depending on full_matrices
-    
+
     For compute_uv = False, only s is returned.
 
     Raises LinAlgError if SVD computation does not converge
@@ -895,14 +895,14 @@
     >>> U, s, Vh = linalg.svd(a)
     >>> U.shape, Vh.shape, s.shape
     ((9, 9), (6, 6), (6,))
-    
+
     >>> U, s, Vh = linalg.svd(a, full_matrices=False)
     >>> U.shape, Vh.shape, s.shape
     ((9, 6), (6, 6), (6,))
     >>> S = diag(s)
     >>> allclose(a, dot(U, dot(S, Vh)))
     True
-    
+
     >>> s2 = linalg.svd(a, compute_uv=False)
     >>> allclose(s, s2)
     True
@@ -969,11 +969,11 @@
 
 def pinv(a, rcond=1e-15 ):
     """Compute the (Moore-Penrose) pseudo-inverse of a matrix.
-    
+
     Calculate a generalized inverse of a matrix using its
     singular-value decomposition and including all 'large' singular
     values.
-    
+
     Parameters
     ----------
     a : array, shape (M, N)
@@ -982,11 +982,11 @@
         Cutoff for 'small' singular values.
         Singular values smaller than rcond*largest_singular_value are
         considered zero.
-    
+
     Returns
     -------
     B : array, shape (N, M)
-    
+
     Raises LinAlgError if SVD computation does not converge
 
     Examples
@@ -998,7 +998,7 @@
     True
     >>> allclose(B, dot(B, dot(a, B)))
     True
-    
+
     """
     a, wrap = _makearray(a)
     _assertNonEmpty(a)
@@ -1028,7 +1028,7 @@
     -------
     det : float or complex
         Determinant of a
-    
+
     Notes
     -----
     The determinant is computed via LU factorization, LAPACK routine z/dgetrf.
@@ -1057,9 +1057,9 @@
 
 def lstsq(a, b, rcond=-1):
     """Compute least-squares solution to equation :m:`a x = b`
-    
+
     Compute a vector x such that the 2-norm :m:`|b - a x|` is minimised.
-    
+
     Parameters
     ----------
     a : array, shape (M, N)
@@ -1068,9 +1068,9 @@
         Cutoff for 'small' singular values.
         Singular values smaller than rcond*largest_singular_value are
         considered zero.
-    
+
     Raises LinAlgError if computation does not converge
-    
+
     Returns
     -------
     x : array, shape (N,) or (N, K) depending on shape of b
@@ -1169,7 +1169,7 @@
         -2     smallest singular value       as below
         other  -                             sum(abs(x)**ord)**(1./ord)
         =====  ============================  ==========================
-    
+
     Returns
     -------
     n : float
@@ -1180,7 +1180,7 @@
     For values ord < 0, the result is, strictly speaking, not a
     mathematical 'norm', but it may still be useful for numerical
     purposes.
-    
+
     """
     x = asarray(x)
     nd = len(x.shape)

Copied: branches/maskedarray/numpy/linalg/setupscons.py (from rev 4776, trunk/numpy/linalg/setupscons.py)

Copied: branches/maskedarray/numpy/numarray/SConstruct (from rev 4776, trunk/numpy/numarray/SConstruct)

Copied: branches/maskedarray/numpy/numarray/setupscons.py (from rev 4776, trunk/numpy/numarray/setupscons.py)

Copied: branches/maskedarray/numpy/oldnumeric/setupscons.py (from rev 4776, trunk/numpy/oldnumeric/setupscons.py)

Copied: branches/maskedarray/numpy/random/SConstruct (from rev 4776, trunk/numpy/random/SConstruct)

Copied: branches/maskedarray/numpy/random/setupscons.py (from rev 4776, trunk/numpy/random/setupscons.py)

Copied: branches/maskedarray/numpy/setupscons.py (from rev 4776, trunk/numpy/setupscons.py)

Copied: branches/maskedarray/numpy/testing/setupscons.py (from rev 4776, trunk/numpy/testing/setupscons.py)

Copied: branches/maskedarray/setupscons.py (from rev 4776, trunk/setupscons.py)

Copied: branches/maskedarray/test.sh (from rev 4776, trunk/test.sh)



More information about the Numpy-svn mailing list