-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
WIP: DatetimeArray+TimedeltaArray #23415
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
Hello @jbrockmendel! Thanks for updating the PR.
Comment last updated on November 11, 2018 at 17:44 Hours UTC |
Codecov Report
@@ Coverage Diff @@
## master #23415 +/- ##
==========================================
- Coverage 92.24% 92.17% -0.07%
==========================================
Files 161 161
Lines 51278 51223 -55
==========================================
- Hits 47299 47216 -83
- Misses 3979 4007 +28
Continue to review full report at Codecov.
|
Quick comment: IMO it is not needed to write tests for basic functioning of eg |
@jbrockmendel What is the status of this, or how does it related to the other PRs? Is this still something you plan to continue working on (so worth to review), or not? |
This is essentially orthogonal to the other PRs ATM. It has been in hold in part because I expect you would be -1 on implementing any parts of the EA interface without implementing all of them. If that expectation is incorrect, then I would probably add |
My expectation (from the title and original description) was that you would further expand this PR to cover the full EA interface, but that is not the plan? |
That was more or less the plan (the "more or less" being that I would have been OK with splitting it into chunks). Besides the trouble with actually implementing this, we've got pieces of this conversation going on in at least four threads, and this is the one I'm most comfortable with letting lie dormant. |
return cls._simple_new(values, freq=freq) | ||
|
||
def copy(self, deep=False): | ||
# TODO: should `deep` determine whether we copy self.asi8? |
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.
yes like
values = self.asi8
if deep:
values = values.copy()
....
|
||
# Following how PeriodArray does this | ||
# TODO: ignoring `type`? | ||
def view(self, dtype=None, type=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.
why is this so complicated? do we really need this method?
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 implemented this because tests were raising AttributeErrors asking for it.
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.
yeah we really can' support .view
generally with EA. maybe just leave this on 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.
Really this PR is still sufficiently early in the "WIP" phase it isn't worth spending much time on ATM.
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.
ok sure
|
||
@classmethod | ||
def _concat_same_type(cls, to_concat): | ||
freqs = {x.freq for x in to_concat} |
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.
you do this freq dance a few times, maybe a helper function?
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'll take a look.
@@ -4242,6 +4242,9 @@ def _try_cast(arr, take_fast_path): | |||
not (is_iterator(subarr) or | |||
isinstance(subarr, np.ndarray))): | |||
subarr = construct_1d_object_array_from_listlike(subarr) | |||
elif type(subarr).__name__ == "DatetimeArray": |
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.
woa??
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.
Yah this is a kludge that should have gotten changed to an isinstance(subarr, ABCDatetimeArray)
before pushing
The useful parts of this are now a strict subset of #23643. Closing. |
I'll be traveling later this week, so trying to get a few things online before disappearing.
So far this just implements
take
andconcat_same_type
. Tests are taken from an older mothballed PR, so are pretty duplicative, need to be cleaned up.