[Numpy-discussion] Useless but tricky exercise
Hi all, Given an array V that is a view of a base B, I was wondering if it is possible to find a (string) index such that `V = B[index]` For example: ``` B = np.arange(8*8).reshape(8,8) V = B[::2,::2] index = find_view(B,V) print(index) "::2,::2" print(np.allclose(V, eval("B[%s]" % index))) True ``` I wrote a solution at https://gist.github.com/rougier/b8c2256434b3a4a4271260cd4cc6cbc7 (not very thoroughly tested) but maybe there are better ways to do that (like a magic numpy call ?) (no use-case at all, only for teaching) Nicolas ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] Branching NumPy 1.12.x
Hi All, I'm thinking that it is time to branch NumPy 1.12.x. I haven't got everything in it that I would have liked, in particular __numpy_ufunc__, but I think there is plenty of material and not branching is holding up some of the more risky stuff. My current thoughts on __numpy_ufunc__ is that it would be best to work it out over the 1.13.0 release cycle, starting with enabling it again right after the branch. Julian's work on avoiding temporary copies and Pauli's overlap handling PR are two other changes I've been putting off but don't want to delay further. There are some other smaller things that I had scheduled for 1.12.0, but would like to spend more time looking at. If there are some things that you think just have to be in 1.12.0, please mention them, but I'd rather aim at getting 1.13.0 out in a timely manner. Thoughts? Chuck ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Using numpy.rint() with scalars
On Thu, Nov 3, 2016 at 9:17 AM, Yuri Sukhovwrote: > Hi all, > > According to the documentation for numpy.rint() ( > https://docs.scipy.org/doc/numpy/reference/generated/numpy.rint.html), > it's a ufunc that accepts an array-like object as an input. > > But it also works with scalar inputs. Could anyone clarify if such use > case is considered to be common and acceptable? It it just the > documentation that does not cover one of the possible scenarios, or is it a > side effect and such use case should be avoided? > > I want to use rint() with scalars as I have not found an alternative with > the same behavior in cPython, but if it's not how it should be used, I > don't want to rewrite the app when that behavior will change. > > Scalars are array_like, they can be converted to arrays. Chuck ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] Using numpy.rint() with scalars
Hi all, According to the documentation for numpy.rint() (https://docs.scipy.org/doc/ numpy/reference/generated/numpy.rint.html), it's a ufunc that accepts an array-like object as an input. But it also works with scalar inputs. Could anyone clarify if such use case is considered to be common and acceptable? It it just the documentation that does not cover one of the possible scenarios, or is it a side effect and such use case should be avoided? I want to use rint() with scalars as I have not found an alternative with the same behavior in cPython, but if it's not how it should be used, I don't want to rewrite the app when that behavior will change. Thanks! Yuri. ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] missing from contributor list?
you can add multiple email addresses to your github settings so commits are properly attributed to your account. On 11/03/2016 11:10 AM, m...@telenczuk.pl wrote: Hi, I had the same problem when I changed my email address. It seems that github matches user profiles to commits using the email address, so you have to make sure that the email you sign your commits with is registered in your github account. Cheers, Bartosz Charles R Harris wrote: On Wed, Nov 2, 2016 at 4:38 PM, Sturla Moldenwrote: Why am I missing from the contributor hist here? https://github.com/numpy/numpy/blob/master/numpy/_ build_utils/src/apple_sgemv_fix.c You still show up in the commit log of if you follow the file ``` git log --follow numpy/_build_utils/apple_accelerate.py ``` So I have to agree with others that the problem is on the github end. Chuck ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] missing from contributor list?
Hi, I had the same problem when I changed my email address. It seems that github matches user profiles to commits using the email address, so you have to make sure that the email you sign your commits with is registered in your github account. Cheers, Bartosz Charles R Harris wrote: > On Wed, Nov 2, 2016 at 4:38 PM, Sturla Molden> wrote: > > > Why am I missing from the contributor hist here? > > > > https://github.com/numpy/numpy/blob/master/numpy/_ > > build_utils/src/apple_sgemv_fix.c > > > > > > > You still show up in the commit log of if you follow the file > ``` > git log --follow numpy/_build_utils/apple_accelerate.py > ``` > > So I have to agree with others that the problem is on the github end. > > Chuck ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion