[Numpy-svn] r3534 - trunk/numpy/lib

numpy-svn@scip... numpy-svn@scip...
Thu Feb 1 18:57:45 CST 2007


Author: oliphant
Date: 2007-02-01 18:57:43 -0600 (Thu, 01 Feb 2007)
New Revision: 3534

Modified:
   trunk/numpy/lib/utils.py
Log:
Fix docstring and rename to byte_bounds.

Modified: trunk/numpy/lib/utils.py
===================================================================
--- trunk/numpy/lib/utils.py	2007-02-02 00:55:40 UTC (rev 3533)
+++ trunk/numpy/lib/utils.py	2007-02-02 00:57:43 UTC (rev 3534)
@@ -8,7 +8,7 @@
 __all__ = ['issubclass_', 'get_numpy_include', 'issubsctype',
            'issubdtype', 'deprecate', 'get_numarray_include',
            'get_include', 'info', 'source', 'who',
-           'memory_bounds', 'may_share_memory']
+           'byte_bounds', 'may_share_memory']
 
 def issubclass_(arg1, arg2):
     try:
@@ -106,12 +106,15 @@
 # Determine if two arrays can share memory
 #--------------------------------------------
 
-def memory_bounds(a):
+def byte_bounds(a):
     """(low, high) are pointers to the end-points of an array
 
     low is the first byte
     high is just *past* the last byte
 
+    If the array is not single-segment, then it may not actually
+    use every byte between these bounds. 
+
     The array provided must conform to the Python-side of the array interface
     """
     ai = a.__array_interface__
@@ -143,8 +146,8 @@
     A return of True does not necessarily mean that the two arrays
     share any element.  It just means that they *might*.
     """
-    a_low, a_high = memory_bounds(a)
-    b_low, b_high = memory_bounds(b)
+    a_low, a_high = byte_bounds(a)
+    b_low, b_high = byte_bounds(b)
     if b_low >= a_high or a_low >= b_high:
         return False
     return True



More information about the Numpy-svn mailing list