-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN: rename reduce-->do_reduce #27706
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
Conversation
pandas/core/arrays/datetimelike.py
Outdated
nonexistent : 'shift_forward', 'shift_backward', 'NaT', timedelta, \ | ||
default 'raise' | ||
nonexistent : 'shift_forward', 'shift_backward', 'NaT', timedelta, | ||
default 'raise' |
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.
this is for proper rendering with numpydoc
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.
darn, will revert.
@@ -328,7 +328,6 @@ class DatetimeArray(dtl.DatetimeLikeArrayMixin, dtl.TimelikeOps, dtl.DatelikeOps | |||
# ----------------------------------------------------------------- | |||
# Constructors | |||
|
|||
_attributes = ["freq", "tz"] |
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.
Why are you removing those attributes? (I suppose they are thus not used) It's a left-over from when it shared code with the Index?
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.
exactly, leftover from the inheritance days
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.
I would also change _reduce in ExtensionArray to match
pandas/_libs/reduction.pyx
Outdated
@@ -628,7 +628,7 @@ cdef class BlockSlider: | |||
arr.shape[1] = 0 | |||
|
|||
|
|||
def reduce(arr, f, axis=0, dummy=None, labels=None): | |||
def do_reduce(arr, f, axis=0, dummy=None, labels=None): |
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.
I don't particular like this name, we don't have anywhere we call things do_*, how about
compute_reduction / apply_reduce
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.
sure
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.
(and its such an easy change to make because I can grep for it!)
need this too |
The Besides, that seems like to defeat Brock's purpose to be able to search for a specific function (and thus not having multiple functions or methods with the same name that do a different thing) |
We have _reduce defined in a bunch of places, renaming it should be a separate discussion |
can you rebase |
rebased+green |
Thanks! |
The current name makes it difficult to grep for.
Assorted cleanups; added type annotations in a few places.