-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REF: move more methods to EAMixins #21782
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
REF: move more methods to EAMixins #21782
Conversation
|
||
Yields | ||
------- | ||
tstamp : Timestamp |
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.
changed from existing version on DatetimeIndex where it says
Returns
-------
Timestamps : ndarray
|
||
Returns | ||
------- | ||
seconds : ndarray, Float64Index, or Series |
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.
updated docstring to include ndarray
|
||
if self.hasnans: | ||
new_data[self._isnan] = tslib.NaT | ||
new_data = PeriodArrayMixin._sub_period(self, other) | ||
|
||
# TODO: Should name=self.name be passed here? |
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 think the answer to this is a) yes, but b) if we remove this method entirely then when the inherited method is called from __sub__
it will correctly get wrapped.
Codecov Report
@@ Coverage Diff @@
## master #21782 +/- ##
==========================================
+ Coverage 91.95% 91.95% +<.01%
==========================================
Files 160 160
Lines 49820 49840 +20
==========================================
+ Hits 45812 45832 +20
Misses 4008 4008
Continue to review full report at Codecov.
|
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.
minor comments, either or in a followup is ok. merge away
@@ -33,6 +33,12 @@ def _box_func(self): | |||
""" | |||
raise com.AbstractMethodError(self) | |||
|
|||
def _box_values(self, values): |
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.
so for future, any methods that we implement in the sub classes but not here, should be an AbstractMethodError (not specific to this comment, just generally)
# GH#19042 | ||
return NotImplemented | ||
|
||
opstr = '__{opname}__'.format(opname=op.__name__).replace('__r', '__') |
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.
we ought to have a method to do exactly this in the base ExtensionOpsMixin (but for later cleanup)
Returns | ||
------- | ||
seconds : ndarray, Float64Index, or Series | ||
When the calling object is a TimedeltaArray, the return type |
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.
can you make this in to a list of these return values
With the exception of the comparison ops, this is the last stuff that can be moved before I have to implement the constructors (and hence a buttload of tests). Let's get this out of the way first.
(For the comparison ops there is some super jujitsu that needs to be un-wound, so will do that separately)