Repository navigation
DEP: Deprecate the axis argument to masked_rows and masked_cols - #14996
Conversation
ee75155 to
675edcf
Compare
|
I feel like it is probably fine to do without a deprecation. But generally speaking, the deprecation is also pretty simple here. So it is a bit annoying, but I think I would just be +0 on going through a short deprecation. It is just the simple decision... |
There was a problem hiding this comment.
The alternative would be to add something like:
if axis in (None, 1, -(np.ndim(a)-1)):
deprecate()
else:
raise TypeError("The axis argument should not be passed, and the value you passed is not what is being used")But this doesn't seem worth it.
There was a problem hiding this comment.
Well, you can just change to np._NoValue and if axis is not np._NoValue: deprecate()?
There was a problem hiding this comment.
This is skipping the deprecation warning for cases when the code is actively wrong - when the axis being used is different to the one the user requested
There was a problem hiding this comment.
Is your plan to delete axis or to change its meaning in the future?
|
Another question: Should this have: (also, 18 or 19? (related: gh-14999)) |
|
We still have a few days for 18, if you want to get rid of this quickly, I am willing to put it in. Its simple enough. Do we need the version changed? I feel like its mostly for people writing for the new NumPy version, but wanting compatibility with old ones. But since the kwarg is removed, they cannot write incompatible code at all. |
It was more intended for users thinking "did I go mad, why did this use to work". Perhaps the release notes are fine for that.
Sans deprecation? |
|
If we rush it into 1.18, then please with deprecation. I do not care about the |
675edcf to
85cfe87
Compare
|
Updated to be a deprecation |
|
Thanks, this looks good to me. I suppose out of principle some test might be good, although also not vital. I might add one and merge in a bit (if Chuck wants to merge it quicker for 1.18, please go ahead). |
|
I think mostly the deprecation tests are important for C code, where we have to check that exceptions are propagated correctly, I probably won't get around to adding one, so would appreciate if you added it yourself. Doesn't seem particularly important, but not harmful either. It would be nice to get this in 1.18 just so we can remove this code one release sooner. |
This argument isn't used, and is confusing. (Small test added by seberg)
85cfe87 to
14bcfd9
Compare
|
Thanks Eric. Lets put this in, the test is minimal (and as you said, not very important in any case). |
This argument isn't used, and is confusing.
Is this worth a deprecation, or should I just outright remove it as I do here?