[NumPy-Tickets] [NumPy] #768: numpy.i suggestion for improvement: require_shape & require_size

NumPy Trac numpy-tickets@scipy....
Thu Apr 14 17:18:40 CDT 2011


#768: numpy.i suggestion for improvement: require_shape & require_size
-------------------------+--------------------------------------------------
 Reporter:  tovrstra     |       Owner:  somebody      
     Type:  enhancement  |      Status:  needs_decision
 Priority:  normal       |   Milestone:  Unscheduled   
Component:  Other        |     Version:  none          
 Keywords:  numpy.i      |  
-------------------------+--------------------------------------------------

Comment(by BillSpotz):

 The reporter is correct that macro `array_size()` and function
 `require_size()` use the term "size" inconsistently.  The proposed
 improvement would make the naming more consistent and add capability by
 adding a new "require" function but retain the old capability by renaming
 a function.

 The primary concern would be backward compatibility.  However, the typical
 use case for a developer would be to copy `numpy.i` into their source
 directory, since it is not automatically installed anywhere.  Thus, most
 legacy users would not notice the change unless they specifically copied a
 newer version of `numpy.i` into their source directory.  For these users,
 I would require the following:

   *  Comments in the code that indicate the changed nature of
 `require_size()` and the fact that `require_shape()` should be called for
 the old functionality,
   * An update to the `numpy_swig.txt` file that explains the name change
 as well,
   * Running `make` in `numpy/doc/swig/doc` to build the new HTML and PDF
 versions of the documentation.

 These would be in addition to the substantive changes of

   * Renaming function `require_size()` to `require_shape()` in `numpy.i`,
   * Changing every occurrence of `require_size()` in `numpy.i` to
 `require_shape()`,
   * Adding the new `require_size()` function as in the description.

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/768#comment:4>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list