Approving NEP 27 - Historical discussion of 0-D arrays

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Approving NEP 27 - Historical discussion of 0-D arrays

mattip
In PR 12166 https://github.com/numpy/numpy/pull/12166 we revived an old
wiki document discussing the implementation of 0-dimensional arrays.
This became informational NEP-27
http://www.numpy.org/neps/nep-0027-zero-rank-arrarys.html. There was
fruitful discussion of the NEP and the need for both 0-D arrays and
scalars on the PR comments. The NEP itself is informational and freezes
the information to the 2006 discussion, noting that "some of the
information here is dated, for instance indexing of 0-D arrays now is
now implemented and does not error."


I would like to submit the NEP for discussion and approval.

Matti

_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion
Reply | Threaded
Open this post in threaded view
|

Re: Approving NEP 27 - Historical discussion of 0-D arrays

einstein.edison
Hi everyone,

Ah, I neglected to see that the PR was already merged. In any case, I’ll repeat my comment here (referring to the indexing section):

I would suggest that this section be removed entirely or updated. For example, if xis either an array scalar or a rank zero array, x[...] is guaranteed to be an array and x[()]is guaranteed to be a scalar. The difference is because x[{anything here}, ...] is guaranteed to be an array. In words, if the last index is an ellipsis, the result of indexing is guaranteed to be an array.

I came across this weird behaviour when implementing the equivalent of np.wherefor PyData/Sparse.


Best Regards,
Hameer Abbasi

On Wednesday, Oct 17, 2018 at 7:59 PM, Matti Picus <[hidden email]> wrote:
In PR 12166 https://github.com/numpy/numpy/pull/12166 we revived an old
wiki document discussing the implementation of 0-dimensional arrays.
This became informational NEP-27
http://www.numpy.org/neps/nep-0027-zero-rank-arrarys.html. There was
fruitful discussion of the NEP and the need for both 0-D arrays and
scalars on the PR comments. The NEP itself is informational and freezes
the information to the 2006 discussion, noting that "some of the
information here is dated, for instance indexing of 0-D arrays now is
now implemented and does not error."


I would like to submit the NEP for discussion and approval.

Matti

_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion

_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion
Reply | Threaded
Open this post in threaded view
|

Re: Approving NEP 27 - Historical discussion of 0-D arrays

Stefan van der Walt
In reply to this post by mattip
On Wed, 17 Oct 2018 20:58:55 +0300, Matti Picus wrote:
> http://www.numpy.org/neps/nep-0027-zero-rank-arrarys.html. There was
> fruitful discussion of the NEP and the need for both 0-D arrays and scalars
> on the PR comments.

Were those comments integrated back into the NEP?  If not, can we add a
paragraph to summarize the discussion?

Stéfan
_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion
Reply | Threaded
Open this post in threaded view
|

Re: Approving NEP 27 - Historical discussion of 0-D arrays

Stephan Hoyer-2
On Wed, Oct 17, 2018 at 4:16 PM Stefan van der Walt <[hidden email]> wrote:
On Wed, 17 Oct 2018 20:58:55 +0300, Matti Picus wrote:
> http://www.numpy.org/neps/nep-0027-zero-rank-arrarys.html. There was
> fruitful discussion of the NEP and the need for both 0-D arrays and scalars
> on the PR comments.

Were those comments integrated back into the NEP?  If not, can we add a
paragraph to summarize the discussion?

Yes, it's in the second paragraph of the "Abstract" section.

_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion
Reply | Threaded
Open this post in threaded view
|

Re: Approving NEP 27 - Historical discussion of 0-D arrays

Stephan Hoyer-2
In reply to this post by mattip
On Wed, Oct 17, 2018 at 10:59 AM Matti Picus <[hidden email]> wrote:
In PR 12166 https://github.com/numpy/numpy/pull/12166 we revived an old
wiki document discussing the implementation of 0-dimensional arrays.
This became informational NEP-27
http://www.numpy.org/neps/nep-0027-zero-rank-arrarys.html. There was
fruitful discussion of the NEP and the need for both 0-D arrays and
scalars on the PR comments.

 We might consider adding a link to the PR under a "Discussion" section, like what you can see for NEP 16.

_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion