Re: [Numpy-discussion] Scipy 2017 NumPy sprint

2017-07-01 Thread Benjamin Root
Just a heads-up. There is now a sphinx-gallery plugin. Matplotlib and a few other projects have migrated their docs over to use it. https://sphinx-gallery.readthedocs.io/en/latest/ Cheers! Ben Root On Sat, Jul 1, 2017 at 7:12 AM, Ralf Gommers wrote: > > > On Fri, Jun 30, 2017 at 6:50 AM, Paul

Re: [Numpy-discussion] Vector stacks

2017-07-01 Thread Juan Nunez-Iglesias
I’m with Nathaniel on this one. Subclasses make code harder to read and reason about because you now have to be sure of the exact type of things that users are passing you — which are array-like but subtly different. On 2 Jul 2017, 9:46 AM +1000, Marten van Kerkwijk , wrote: > I'm not sure ther

Re: [Numpy-discussion] Vector stacks

2017-07-01 Thread Marten van Kerkwijk
I'm not sure there is *that* much against a class that basically just passes through views of itself inside `__matmul__` and `__rmatmul__` or calls new gufuncs, but I think the lower hurdle is to first get those gufuncs implemented. -- Marten ___ NumPy-Di

Re: [Numpy-discussion] Vector stacks

2017-07-01 Thread Nathaniel Smith
On Sat, Jul 1, 2017 at 3:31 PM, Charles R Harris wrote: > Hi All, > > The '@' operator works well with stacks of matrices, but not with stacks of > vectors. Given the recent addition of '__array_ufunc__', and the intent to > make `__matmul__` use a ufunc, I've been wondering is it would make sen

Re: [Numpy-discussion] Vector stacks

2017-07-01 Thread Eric Wieser
What would these classes offer over these simple functions: def rvec(x): return x[...,np.newaxis,:]def cvec(x): return x[...,:,np.newaxis] That also makes rvec(x) + cvec(y) behave in the least surprising way, with no extra work Eric ​ On Sat, 1 Jul 2017 at 23:32 Charles R Harris wrote: > Hi

[Numpy-discussion] Vector stacks

2017-07-01 Thread Charles R Harris
Hi All, The '@' operator works well with stacks of matrices, but not with stacks of vectors. Given the recent addition of '__array_ufunc__', and the intent to make `__matmul__` use a ufunc, I've been wondering is it would make sense to add ndarray subclasses 'rvec' and 'cvec' that would override

Re: [Numpy-discussion] Scipy 2017 NumPy sprint

2017-07-01 Thread Ralf Gommers
On Fri, Jun 30, 2017 at 6:50 AM, Pauli Virtanen wrote: > Charles R Harris kirjoitti 29.06.2017 klo 20:45: > > Here's a random idea: how about building a NumPy gallery? > > scikit-{image,learn} has it, and while those projects may have more > > visual datasets, I can imagine something