Skip to content

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

Merged
merged 17 commits into from
Aug 5, 2019
Merged

Conversation

jbrockmendel
Copy link
Member

The current name makes it difficult to grep for.

Assorted cleanups; added type annotations in a few places.

nonexistent : 'shift_forward', 'shift_backward', 'NaT', timedelta, \
default 'raise'
nonexistent : 'shift_forward', 'shift_backward', 'NaT', timedelta,
default 'raise'
Copy link
Member

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

Copy link
Member Author

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"]
Copy link
Member

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?

Copy link
Member Author

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

Copy link
Contributor

@jreback jreback left a 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

@@ -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):
Copy link
Contributor

@jreback jreback Aug 2, 2019

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

Copy link
Member Author

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!)

@jreback jreback added the Internals Related to non-user accessible pandas implementation label Aug 2, 2019
@jreback
Copy link
Contributor

jreback commented Aug 2, 2019

I would also change _reduce in ExtensionArray to match

need this too

@jorisvandenbossche
Copy link
Member

The _reduce is part of the EA interface, so we cannot just rename that.

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)

@jbrockmendel
Copy link
Member Author

We have _reduce defined in a bunch of places, renaming it should be a separate discussion

@jreback jreback added this to the 1.0 milestone Aug 4, 2019
@jreback
Copy link
Contributor

jreback commented Aug 4, 2019

can you rebase

@jbrockmendel
Copy link
Member Author

rebased+green

@jorisvandenbossche jorisvandenbossche merged commit 9c37226 into pandas-dev:master Aug 5, 2019
@jorisvandenbossche
Copy link
Member

Thanks!

@jbrockmendel jbrockmendel deleted the nopat branch August 5, 2019 14:32
quintusdias pushed a commit to quintusdias/pandas_dev that referenced this pull request Aug 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internals Related to non-user accessible pandas implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants