[Numpy-discussion] NumPy v1.13.0rc1 released.

Marten van Kerkwijk m.h.vankerkwijk at gmail.com
Thu May 11 15:51:57 EDT 2017


Hi All,

Do indeed try __array_ufunc__! It should make many things work much
better and possibly faster than was possible with __array_prepare__
and __array_wrap__ (for astropy's Quantity, an ndarray subclass than I
maintain, it gets us a factor of almost 2 in speed for operations
where scaling for units is needed; for array-like classes, it should
enable things that were nearlyimpossible before).

About documentation, I'm not quite sure how to get the documentation
on scipy.docs.org to update (the developer version points points to
1.13dev0 and is last updated in January). Beyond the links Nathaniel
sent, there is also one more specifically aimed at subclasses:

 https://github.com/numpy/numpy/blob/master/numpy/doc/subclassing.py

As noted, the API is provisional, which I hope it all the more reason
to try it out if you think this could be useful -- and do let us know
on github what works and what doesn't [e.g., there is a lively
discussion on whether `ndarray` having its own `__array_ufunc__` for
subclasses to super to is in fact a good idea -- for Quantity, I find
it quite convenient (but then I implemented it...), but perhaps it is
too confusing.  See

https://github.com/numpy/numpy/issues/9079

All the best,

Marten


More information about the NumPy-Discussion mailing list