Repository navigation
DEP: deprecate asscalar - #12123
DEP: deprecate asscalar#12123
Conversation
|
👍 This seems like a nice resolution to me. The function is basically useless. |
|
Hmm, what is the reason to only deprecate it in the docstring? Should it raise a deprecation warning? |
|
Agree that it needs a |
1c2a643 to
af5d32c
Compare
|
@charris thanks. Added actual deprecation warning. |
There was a problem hiding this comment.
No need for VisibleDeprecationWarning I think - use the normal one.
Also, this should suggest something like "use .item() instead"
There was a problem hiding this comment.
This second sentence should be indented under the .. deprecated block
af5d32c to
1c2abd3
Compare
| """ | ||
|
|
||
| # 2018-10-10, 1.16 | ||
| warnings.warn('np.asscalar(a) will be removed in v1.18 of numpy, use ' |
There was a problem hiding this comment.
I think we are headed toward using the version deprecated rather than the version in which we intend to remove it. The latter may change, the first is fixed and helps folks downstream know how to set up version dependent workarounds.
|
Thanks Matti. |
|
Sorry, but why this handy function got deprecated in favor of |
|
@the-admax:
Both would fail if |
Closes #4701 (issue). Closes #11856 (PR). Closes #10256 (PR). Closes #10659 (PR).
This issue was labelled "easy" which led to the multiple PRs to fix it. I propose to deprecate it instead, as it is neither used nor tested in numpy, and is a thin wrapper to
ndarray.item()but accepts none of theargs.SciPy does not use
asscalar, astropy has two uses ofasscalarwhich would need fixing.