-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
DEP: Deprecate the keepdims argument to accumulate #8198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DEP: Deprecate the keepdims argument to accumulate #8198
Conversation
c2901c6
to
bcc4025
Compare
OK, looks good. Two more things, add an entry to the
|
At this point you must feel like you are getting nickle and dimed to death ;) Thanks for your patience. Changing arguments/behavior is an ambitious thing... |
@@ -3891,18 +3894,29 @@ PyUFunc_GenericReduction(PyUFuncObject *ufunc, PyObject *args, | |||
} | |||
} | |||
else if (operation == UFUNC_ACCUMULATE) { | |||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|OO&O&i", kwlist1, | |||
PyObject *bad_keepdimarg; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to initialize to NULL
.
What exactly is this comment trying to achieve? Doesn't a |
bcc4025
to
35736af
Compare
Updated with tests and a NULL initialization |
""" | ||
Deprecate the keepdims argument to np.ufunc.accumulate, which was never used or documented | ||
""" | ||
def test_keepdims(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Want this:
with warnings.catch_warnings():
warnings.filterwarnings('always', '', FutureWarning)
assert_warns(FutureWarning, np.add.accumulate, [1], keepdims=True)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
35736af
to
5b9e7ee
Compare
Thanks @eric-wieser . |
As discussed in #8187