[Numpy-svn] r3122 - in trunk/numpy: . core/src

numpy-svn at scipy.org numpy-svn at scipy.org
Tue Sep 5 13:36:51 CDT 2006


Author: charris
Date: 2006-09-05 13:36:49 -0500 (Tue, 05 Sep 2006)
New Revision: 3122

Modified:
   trunk/numpy/add_newdocs.py
   trunk/numpy/core/src/multiarraymodule.c
Log:
Docstring for tostring and small formatting change to PyArray_SearchSorted.

Modified: trunk/numpy/add_newdocs.py
===================================================================
--- trunk/numpy/add_newdocs.py	2006-09-05 16:58:59 UTC (rev 3121)
+++ trunk/numpy/add_newdocs.py	2006-09-05 18:36:49 UTC (rev 3122)
@@ -1067,7 +1067,8 @@
     If 'sep' is empty this method is equivalent to file.write(a.tostring()). If
     'sep' is not empty each data item is converted to the nearest Python type
     and formatted using "format"%item. The resulting strings are written to the
-    file separated by the contents of 'sep'.
+    file separated by the contents of 'sep'. The data is always written in "C"
+    (row major) order independent of the order of 'a'.
 
     The data produced by this method can be recovered by using the function
     fromfile().
@@ -1079,16 +1080,27 @@
     """a.tolist() -> Array as hierarchical list.
 
     Copy the data portion of the array to a hierarchical python list and return
-    that list.
+    that list. Data items are converted to the nearest compatible Python type.
 
     """))
 
 
 add_newdoc('numpy.core.multiarray', 'ndarray', ('tostring',
-    """a.tostring(order='C') -> binary array data as Python string.
+    """a.tostring(order='C') -> raw copy of array data as a Python string.
 
-    Construct a Python string containing the raw bytes in the array.
+    Keyword arguments:
+        order -- order of the data item in the copy {"C","F","A"} (default "C")
 
+    Construct a Python string containing the raw bytes in the array. The order
+    of the data in arrays with ndim > 1 is specified by the 'order' keyword and
+    this keyword overrides the order of the array. The
+    choices are:
+
+        "C"       -- C order (row major)
+        "Fortran" -- Fortran order (column major)
+        "Any"     -- Current order of array.
+        None      -- Same as "Any"
+
     """))
 
 

Modified: trunk/numpy/core/src/multiarraymodule.c
===================================================================
--- trunk/numpy/core/src/multiarraymodule.c	2006-09-05 16:58:59 UTC (rev 3121)
+++ trunk/numpy/core/src/multiarraymodule.c	2006-09-05 18:36:49 UTC (rev 3122)
@@ -2659,7 +2659,8 @@
                 NPY_BEGIN_THREADS_DESCR(ap2->descr)
                 local_search_left(ap1, ap2, ret);
                 NPY_END_THREADS_DESCR(ap2->descr)
-        } else if (which == NPY_SEARCHRIGHT) {
+        }
+        else if (which == NPY_SEARCHRIGHT) {
                 NPY_BEGIN_THREADS_DESCR(ap2->descr)
                 local_search_right(ap1, ap2, ret);
                 NPY_END_THREADS_DESCR(ap2->descr)



More information about the Numpy-svn mailing list