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

numpy-svn at scipy.org numpy-svn at scipy.org
Mon Aug 28 00:56:56 CDT 2006


Author: charris
Date: 2006-08-28 00:56:49 -0500 (Mon, 28 Aug 2006)
New Revision: 3084

Modified:
   trunk/numpy/add_newdocs.py
   trunk/numpy/core/src/arraymethods.c
Log:
Break up the documentation of ndarray attributes into separate calls.


Modified: trunk/numpy/add_newdocs.py
===================================================================
--- trunk/numpy/add_newdocs.py	2006-08-28 00:37:14 UTC (rev 3083)
+++ trunk/numpy/add_newdocs.py	2006-08-28 05:56:49 UTC (rev 3084)
@@ -313,14 +313,16 @@
 #
 # Todo:
 #
-# break out attributes separately
+# expand and reformat documentation.
 #
-# Attributes and module documentation are still defined elsewhere,
-# so don't show up yet.
+# do all methods prior to Extended methods added 2005
 #
-# expand and reformat other documentation.
+##############################################################################
+
+
+##############################################################################
 #
-# all methods prior to Extended methods added 2005
+# ndarray object
 #
 ##############################################################################
 
@@ -347,33 +349,104 @@
 
  No __init__ method is needed because the array is fully
  initialized after the __new__ method.
+
 """)
 
 
-add_newdoc('numpy.core.multiarray', 'ndarray',
-           [('ndim', 'number of array dimensions'),
-            ('flags', 'special object providing array flags'),
-            ('shape', 'tuple of array dimensions'),
-            ('strides', 'tuple of bytes to step in each dimension'),
-            ('data', 'buffer object pointing to the start of the data'),
-            ('itemsize', 'length of one element in bytes'),
-            ('size', 'number of elements in the array'),
-            ('nbytes', 'number of bytes in the array'),
-            ('base', 'base object if memory is from some other object'),
-            ('dtype', 'data-type for the array'),
-            ('real', 'real part of the array'),
-            ('imag', 'imaginary part of the array'),
-            ('flat', 'a 1-d flat iterator'),
-            ('ctypes', 'a ctypes interface object'),
-            ('_as_parameter_', 'allow the array to be interpreted as a ctypes object by returning the data-memory location as an integer'),
-            ('T', 'equivalent to self.transpose() except self is returned for self.ndim < 2'),
-            ('__array_interface__', 'Array protocol: Python side'),
-            ('__array_struct__', 'Array protocol: C-struct side'),
-            ('__array_priority__', 'Array priority'),
-            ('__array_finalize__', 'None')
-            ])
+##############################################################################
+#
+# ndarray attributes
+#
+##############################################################################
 
 
+add_newdoc('numpy.core.multiarray', 'ndarray', ('__array_interface__',
+"""Array protocol: Python side."""))
+
+
+add_newdoc('numpy.core.multiarray', 'ndarray', ('__array_finalize__',
+"""None."""))
+
+
+add_newdoc('numpy.core.multiarray', 'ndarray', ('__array_priority__',
+"""Array priority."""))
+
+
+add_newdoc('numpy.core.multiarray', 'ndarray', ('__array_struct__',
+"""Array protocol: C-struct side."""))
+
+
+add_newdoc('numpy.core.multiarray', 'ndarray', ('_as_parameter_',
+"""Allow the array to be interpreted as a ctypes object by returning the
+data-memory location as an integer"""))
+
+
+add_newdoc('numpy.core.multiarray', 'ndarray', ('base',
+"""Base object if memory is from some other object."""))
+
+
+add_newdoc('numpy.core.multiarray', 'ndarray', ('ctypes',
+"""A ctypes interface object."""))
+
+
+add_newdoc('numpy.core.multiarray', 'ndarray', ('data',
+"""Buffer object pointing to the start of the data."""))
+
+
+add_newdoc('numpy.core.multiarray', 'ndarray', ('dtype',
+"""Data-type for the array."""))
+
+
+add_newdoc('numpy.core.multiarray', 'ndarray', ('imag',
+"""Imaginary part of the array."""))
+
+
+add_newdoc('numpy.core.multiarray', 'ndarray', ('itemsize',
+"""Length of one element in bytes."""))
+
+
+add_newdoc('numpy.core.multiarray', 'ndarray', ('flags',
+"""Special object providing array flags."""))
+
+
+add_newdoc('numpy.core.multiarray', 'ndarray', ('flat',
+"""A 1-d flat iterator."""))
+
+
+add_newdoc('numpy.core.multiarray', 'ndarray', ('nbytes',
+"""Number of bytes in the array."""))
+
+
+add_newdoc('numpy.core.multiarray', 'ndarray', ('ndim',
+"""Number of array dimensions."""))
+
+
+add_newdoc('numpy.core.multiarray', 'ndarray', ('real',
+"""Real part of the array."""))
+
+
+add_newdoc('numpy.core.multiarray', 'ndarray', ('shape',
+"""Tuple of array dimensions."""))
+
+
+add_newdoc('numpy.core.multiarray', 'ndarray', ('size',
+"""Number of elements in the array."""))
+
+
+add_newdoc('numpy.core.multiarray', 'ndarray', ('strides',
+"""Tuple of bytes to step in each dimension."""))
+
+
+add_newdoc('numpy.core.multiarray', 'ndarray', ('T',
+"""Equivalent to self.transpose() except self is returned for self.ndim < 2."""))
+
+
+##############################################################################
+#
+# ndarray methods
+#
+##############################################################################
+
 add_newdoc('numpy.core.multiarray', 'ndarray', ('all',
 """ a.all(axis=None)
 

Modified: trunk/numpy/core/src/arraymethods.c
===================================================================
--- trunk/numpy/core/src/arraymethods.c	2006-08-28 00:37:14 UTC (rev 3083)
+++ trunk/numpy/core/src/arraymethods.c	2006-08-28 05:56:49 UTC (rev 3084)
@@ -229,8 +229,8 @@
 }
 
 static char doc_getfield[] = "m.getfield(dtype, offset) returns a field "\
-	" of the given array as a certain type.  A field is a view of "\
-	" the array's data with each itemsize determined by the given type"\
+	" of the given array as a certain type. \nA field is a view of "\
+	" the array's data with each itemsize determined by the\ngiven type"\
 	" and the offset into the current array.";
 
 /* steals typed reference */



More information about the Numpy-svn mailing list