DEP: Deprecate passing shape=None to mean shape=()#15886
Conversation
b92985a to
43490a2
Compare
|
Probably needs testing against the scipy and pandas testsuites |
|
Is there a concrete benefit besides it being a little cleaner? |
seberg
left a comment
There was a problem hiding this comment.
I assume that that nobody uses it in most cases. I looked through our own code base usage, and we seem fine. The main issue would be reduction-like functions not accepting None anymore.
The most unsure I was was whether descriptors should keep accepting None to mean no-subarray. A test for array creation functions might be good (they seem the most visible users), or test it directly with the new testing functions.
As in,
I'd forgotten I now have tests for the converters. A test for |
|
Thanks, was just going to say that the tests seem still needed. The only usage in scipy is fine. If anyone needs it, I guess we could consider making the optional version public, but dunno... |
|
@eric-wieser sorry for the followup, those commands ( |
|
Huh, I think I was testing those on 1.17.0. Did we add support for None on purpose? |
|
I don't recall adding it on purpose, was probably an accident... Anyway, it doesn't matter too much? Just deprecate it again now. I don't mind if None works, but it also doesn't seem very useful for me (and |
4caa0ac to
abb0c83
Compare
This requires some minor tweaks in `np.random` because there the two have different meanings, with `()` meaning 0d array and `None` meaning scalar.
abb0c83 to
5443f6d
Compare
I still can't work out the case you're describing here. Can you give me the input/output pair that you're referring to With this patch, the suggestions I mention above give |
|
Eric: works for me, in master as well as 1.18 |
|
Got it, thanks. Works for me too in this branch with no warning. My issue was using |
|
Ah OK, I guess this is already special cased there, sorry for the noise. |
|
I think I'm fine continuing to allow |
|
Thanks for the test Eric, lets put this in. |
This requires some minor tweaks in
np.randombecause there the two have different meanings, with()meaning 0d array andNonemeaning scalar.Made primarily to answer the question of how noisy this would be, from #15877 (comment).