<div dir="auto">I would also argue against deprecating these functions that we are using increasingly in several projects that I am involved in.</div><br><div class="gmail_quote"><div dir="ltr">On Sat, Oct 27, 2018, 01:28 Travis Oliphant <<a href="mailto:teoliphant@gmail.com">teoliphant@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">What is the justification for deprecation exactly?  These functions have been well documented and have had the intended behavior of producing arrays with dimension at least 1 for some time.  Why is it unexpected to produce arrays of at least 1 dimension?  For some users this is exactly what is wanted.  I don't understand the statement that behavior with 0-d arrays is unexpected.<div><br></div><div>If the desire is to shrink the API of NumPy, I could see that.   But, it seems odd to me to remove a much-used function with an established behavior except as part of a wider API-shrinkage effort. </div><div><br></div><div>0-d arrays in NumPy are a separate conversation.  At this point, I think it was a mistake not to embrace 0-d arrays in NumPy from day one.  In some sense 0-d arrays *are* scalars at least conceptually and for JIT-producing systems that exist now and will be growing in the future, they can be equivalent to scalars.  </div><div><br></div><div>The array scalars should become how you define what is *in* a NumPy array making them true Python types, rather than Python 1-style "instances" of a single "Dtype" object.  You would then have 0-d arrays and these Python "memory" types describing what is *in* the array.  </div><div><br></div><div>There is a clear way to do this, some of which has been outlined by Nathaniel, and the rest I have an outline for how to implement.  I can advise someone on how to do this.  </div><div><br></div><div>-Travis</div><div><br></div><div><br></div><div> </div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Oct 25, 2018 at 3:17 PM Alex Rogozhnikov <<a href="mailto:alex.rogozhnikov@yandex.ru" target="_blank" rel="noreferrer">alex.rogozhnikov@yandex.ru</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Dear numpy community,</div><div> </div><div>I'm planning to depreciate np.asfortranarray and np.ascontiguousarray</div><div>functions due to their misbehavior on scalar (0-D tensors) with PR <span>#12244</span>.</div><div> </div><div>Current behavior (converting scalars to 1-d array with single element)</div><div>- is unexpected and contradicts to documentation</div><div>- probably, can't be changed without breaking external code</div><div>- I believe, this was a cause for poor support of 0-d arrays in mxnet.</div><div>- both functions are easily replaced with asarray(..., order='...'), which has expected behavior</div><div> </div><div>There is no timeline for removal - we just need to discourage from using this functions in new code.</div><div> </div><div>Function naming may be related to how numpy treats 0-d tensors specially,  </div><div>and those probably should not be called arrays.</div><div><div><a href="https://www.numpy.org/neps/nep-0027-zero-rank-arrarys.html" target="_blank" rel="noreferrer">https://www.numpy.org/neps/nep-0027-zero-rank-arrarys.html</a></div><div>However, as a user I never thought about 0-d arrays being special and being "not arrays".</div><div> </div></div><div> </div><div>Please see original discussion at github for more details</div><div><a href="https://github.com/numpy/numpy/issues/5300" target="_blank" rel="noreferrer">https://github.com/numpy/numpy/issues/5300</a></div><div> </div><div>Your comments welcome,</div><div>Alex Rogozhnikov<br> </div>_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@python.org" target="_blank" rel="noreferrer">NumPy-Discussion@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/numpy-discussion" rel="noreferrer noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/numpy-discussion</a><br>
</blockquote></div>
_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@python.org" target="_blank" rel="noreferrer">NumPy-Discussion@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/numpy-discussion" rel="noreferrer noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/numpy-discussion</a><br>
</blockquote></div>