Skip to content

CLN: remove _maybe_update_attributes #27896

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 5 commits into from
Aug 15, 2019
Merged

Conversation

jbrockmendel
Copy link
Member

It is only non-trivial for DTI and TDI, and only actually needed in __array_wrap__. It is cleaner to implement the relevant patch in DatetimeIndexOpsMixin.__array_wrap__ and avoid the need for maybe_update_attributes altogether.

def __neg__(self):
if self.freq is not None:
return type(self)(-self._data, freq=-self.freq)
return type(self)(-self._data)

def __pos__(self):
return type(self)(self._data, freq=self.freq)
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 new? Or where was it done before?

Copy link
Contributor

Choose a reason for hiding this comment

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

In _add_numeric_methods_unary.

@@ -163,6 +164,20 @@ def values(self):
def asi8(self):
return self._data.asi8

def __array_wrap__(self, result, context=None):
Copy link
Member

Choose a reason for hiding this comment

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

sidenote (not for this PR): we should move to __array_ufunc__ here instead

Copy link
Contributor

Choose a reason for hiding this comment

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

agreed on this, can you create an issue @jbrockmendel

def __neg__(self):
if self.freq is not None:
return type(self)(-self._data, freq=-self.freq)
return type(self)(-self._data)

def __pos__(self):
return type(self)(self._data, freq=self.freq)
Copy link
Contributor

Choose a reason for hiding this comment

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

In _add_numeric_methods_unary.

@jreback jreback added this to the 1.0 milestone Aug 14, 2019
@jreback jreback added the Clean label Aug 14, 2019
@jreback
Copy link
Contributor

jreback commented Aug 14, 2019

can you rebase

@jreback jreback merged commit 48dd753 into pandas-dev:master Aug 15, 2019
@jbrockmendel jbrockmendel deleted the mua branch August 15, 2019 14:22
quintusdias pushed a commit to quintusdias/pandas_dev that referenced this pull request Aug 16, 2019
@WillAyd
Copy link
Member

WillAyd commented Oct 18, 2019

Took a glance at the ASV portal this might have caused a lot of performance regressions:

https://pandas.pydata.org/speed/pandas/#/regressions

@jbrockmendel do you have a quick way of validating that?

@jbrockmendel
Copy link
Member Author

do you have a quick way of validating that?

Not a quick way, no. I'll take a look, but likely won't get to it today.

@WillAyd
Copy link
Member

WillAyd commented Oct 18, 2019

Oh yea no rush - thanks!

@jbrockmendel
Copy link
Member Author

@WillAyd looking at this it isn't obvious which regressions you think may have been caused here. I see a bunch from August 15 linking to 15b11c8; are those the ones you have in mind?

@WillAyd
Copy link
Member

WillAyd commented Oct 19, 2019 via email

@jorisvandenbossche
Copy link
Member

It's indeed this commit that asv reports for the biggest regressions. But there was also a gap in asv runs between August 2 and this commit (August 15), so probably it can be anything in that window

@jorisvandenbossche
Copy link
Member

@TomAugspurger it also seems that the last runs were in September?

@TomAugspurger
Copy link
Contributor

TomAugspurger commented Oct 19, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants