-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REF: use asi8 instead of _data in PeriodArray #23416
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 submitting the PR.
|
pandas/core/indexes/period.py
Outdated
elif not is_integer(periods): | ||
msg = 'periods must be a number, got {periods}' | ||
raise TypeError(msg.format(periods=periods)) | ||
|
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.
This is done within PeriodArray._generate_range
Codecov Report
@@ Coverage Diff @@
## master #23416 +/- ##
=======================================
Coverage 92.21% 92.21%
=======================================
Files 161 161
Lines 51173 51173
=======================================
Hits 47190 47190
Misses 3983 3983
Continue to review full report at Codecov.
|
What I remember from the call is that we said that For example, the |
I actually like _data as it very consistent across all array-like things. pls split out other changes to another PR if you would. |
The audio issues on the call must have been much worse than we realized, since I don't recall that at all. It wouldn't make sense to use asi8 as the name used in
This would, in fact, also work fine returning
I can split out the other stuff, but am not ready to give up on the central point here: The ongoing trouble with values/_values/_ndarray_values/_data/... is driven by ambiguity. When I see one of these used, it isn't immediately obvious what it means. This PR changes usages of the maximally-ambiguous name to the maximally-obvious name. |
But I think it would still make sense to use the same attribute name for all datetimelike arrays, and in basic functionality (like I am fine with another name as
Yes, and for the ops in the PerioArray code, it uses
That would work, but I don't think it would be nicer or clearer design than using the 'base' data attribute. |
As you mentioned in the linked comment,
What this PR does do is replace usages of a highly-overloaded name with usages of an entirely-clear name. If later we need to tinker with it in order to share code with other Datetimelike EAs, I'm fine with that. |
I am not sure how this is different from |
Not a priority, closing. |
@TomAugspurger @jorisvandenbossche discussed on the call a couple weeks ago. Reference
asi8
instead of_data
or_ndarray_values
is the most-explicit option available.I would also be in favor of getting rid of
_data
directly and settingasi8
in__init__
, but holding off on that pending consensus.Also re-implemented some simplifications that got lost in rebasing during the PeriodArray marathon.