Skip to content

Conversation

jbrockmendel
Copy link
Member

PeriodIndex comparisons turn out to be easier to move than the others (though partly because ATM they are broken: #21793), so this moves them over first.

Following that, most of the remaining PeriodArray arithmetic methods require shift, which in turns requires the constructors, so I went ahead and implemented those in PeriodArrayMixin. Still holding off on TimedeltaArray and DatetimeArray constructors.

Found a few more things that could be harmlessly moved and some docstring fixups.

CC: @jorisvandenbossche @TomAugspurger @jreback



def _period_array_cmp(opname, cls):
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

in the future can you add some comments / doc-string here

raise IncompatibleFrequency(msg.format(cls=type(self).__name__,
freqstr=self.freqstr))

@classmethod
Copy link
Contributor

Choose a reason for hiding this comment

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

should this use ExtensionOpsMixin ?

@jreback jreback added Period Period data type ExtensionArray Extending pandas with custom dtypes or arrays. labels Jul 7, 2018
@jreback jreback added this to the 0.24.0 milestone Jul 7, 2018
@jreback jreback merged commit eb95979 into pandas-dev:master Jul 7, 2018
@jreback
Copy link
Contributor

jreback commented Jul 7, 2018

thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the dtarrays23 branch July 7, 2018 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ExtensionArray Extending pandas with custom dtypes or arrays. Period Period data type

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants