-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Collect Index methods by purpose: rendering, constructors, setops... #23961
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.
|
travis failure appears unrelated |
Codecov Report
@@ Coverage Diff @@
## master #23961 +/- ##
==========================================
+ Coverage 92.31% 92.31% +<.01%
==========================================
Files 161 161
Lines 51471 51473 +2
==========================================
+ Hits 47515 47517 +2
Misses 3956 3956
Continue to review full report at Codecov.
|
nd_state, own_state = state | ||
data = np.empty(nd_state[1], dtype=nd_state[2]) | ||
np.ndarray.__setstate__(data, nd_state) | ||
self.name = own_state[0] |
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.
indexing methods
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.
what method was this comment supposed to refer to?
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.
oh this section, basically group all of the indexing (and indexer conversion methods)
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.
IOW also include __getitem__
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.
Not asking what section, asking what method. On GH your comment is pointing towards __setstate__
, which I really doubt you mean should go in the indexing section
|
||
See Also | ||
-------- | ||
numpy.ndarray.putmask |
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.
reshaping methods
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.
what method was this comment supposed to refer to?
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.
append/concat section
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.
Same, asking what method, not what section
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.
generally ok, some comments. ideally put the same sections in the subclasses, even if they are empty (could be followup if needed)
nd_state, own_state = state | ||
data = np.empty(nd_state[1], dtype=nd_state[2]) | ||
np.ndarray.__setstate__(data, nd_state) | ||
self.name = own_state[0] |
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.
oh this section, basically group all of the indexing (and indexer conversion methods)
.. versionadded:: 0.19.0 | ||
""" | ||
|
||
@Appender(_index_shared_docs['astype']) |
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.
maybe this goes in conversion
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 considered that, thought that ndarray-like methods should take priority
pandas/core/indexes/base.py
Outdated
""" | ||
return value | ||
|
||
def _assert_can_do_op(self, value): |
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.
maybe to the Array section?
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 only actually used for fillna
, so maybe in the null-handling section? its a weird fit
pandas/core/indexes/base.py
Outdated
|
||
@cache_readonly | ||
def is_unique(self): | ||
""" |
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.
maybe consider these 2 introspection to the unique section
nd_state, own_state = state | ||
data = np.empty(nd_state[1], dtype=nd_state[2]) | ||
np.ndarray.__setstate__(data, nd_state) | ||
self.name = own_state[0] |
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.
IOW also include __getitem__
|
||
See Also | ||
-------- | ||
numpy.ndarray.putmask |
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.
append/concat section
collected uncategorized methods in one block just above generated-methods. implemented the subset of suggestions that didn't need clarification. This is liable to become a rebasing nightmare if left open. I think should be multi-pass process. |
thanks. if any comments you didn't address here, pls do in a followup. |
Zero changes to the contents of any methods, just collecting them in reasonably-scoped sections.