[pypy-issue] [issue981] micronumpy 'fromnumeric' patch

mikefc tracker at bugs.pypy.org
Wed Jan 4 22:40:45 CET 2012

New submission from mikefc <coolbutuseless at gmail.com>:

Hi All,

Numpy is somewhat derived from another array library called 'Numeric'.  What were originally 
functions in 'Numeric' have been promoted to ndarray methods in numpy.  The implementation of 
this code in numpy is in numpy/core/fromnumeric.py. The list of functions that were promoted is 
listed at the end of this email.

However, these functions must be retained for compatibility, but all they should do is call the 
ndarray method.
e.g. "numpy.ravel(a)" is just a wrapper which returns "a.ravel()"

I have:
* copied all docstrings from numpy1.6 numpy/core/fromnumeric.py  into micronumpy/app_numpy.py
* for methods which we currently have (e.g. max, argmax), I have 
    * made the function just call the relavant method and return the value
    * written a test_fromnumeric_* using the docstring examples
* for methods which we don't have I have raised a NotImplemented Error

I realise that this is a lot of boring boilerplate code & docstrings, but I think it's to 
everyone's advantage to flesh out the micronumpy implementation a bit more so that we can see 
what has/hasn't been done. 

This will also be useful to newcomers - like me - who can now find obvious functions that need 

Could someone please review, fix if necessary (or let me know what needs to be fixed) and commit.

# __all__ = ['take', 'reshape', 'choose', 'repeat', 'put',
#            'swapaxes', 'transpose', 'sort', 'argsort', 'argmax', 'argmin',
#            'searchsorted', 'alen',
#            'resize', 'diagonal', 'trace', 'ravel', 'nonzero', 'shape',
#            'compress', 'clip', 'sum', 'product', 'prod', 'sometrue', 'alltrue',
#            'any', 'all', 'cumsum', 'cumproduct', 'cumprod', 'ptp', 'ndim',
#            'rank', 'size', 'around', 'round_', 'mean', 'std', 'var', 'squeeze',
#            'amax', 'amin',
#           ]

files: numpypy_fromnumeric.patch
messages: 3640
nosy: mikefc, pypy-issue
priority: feature
status: unread
title: micronumpy 'fromnumeric' patch

PyPy bug tracker <tracker at bugs.pypy.org>

More information about the pypy-issue mailing list