-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
DOC: Add docstrings to matplotlib.cbook.GrouperView #29617
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
09ffea8
DOC: Add docstrings to matplotlib.cbook.GrouperView
star1327p 6aedbe2
Merge branch 'matplotlib:main' into add-docstring-cbook-api
star1327p 76dd8be
DOC: Fixed linting errors in cbook.py
star1327p c951f1a
Update cbook.py
star1327p 8d2b682
Update cbook.py
star1327p 08982e9
Revert unnecessary changes
star1327p eb7cae3
Removed unnecessary whitespace
star1327p File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -850,11 +850,15 @@ | |
mapping[elem] = set_a | ||
|
||
def joined(self, a, b): | ||
"""Return whether *a* and *b* are members of the same set.""" | ||
""" | ||
Return whether *a* and *b* are members of the same set. | ||
""" | ||
return (self._mapping.get(a, object()) is self._mapping.get(b)) | ||
|
||
def remove(self, a): | ||
"""Remove *a* from the grouper, doing nothing if it is not there.""" | ||
""" | ||
Remove *a* from the grouper, doing nothing if it is not there. | ||
""" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As above. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
self._mapping.pop(a, {a}).remove(a) | ||
self._ordering.pop(a, None) | ||
|
||
|
@@ -880,8 +884,16 @@ | |
def __init__(self, grouper): self._grouper = grouper | ||
def __contains__(self, item): return item in self._grouper | ||
def __iter__(self): return iter(self._grouper) | ||
def joined(self, a, b): return self._grouper.joined(a, b) | ||
def get_siblings(self, a): return self._grouper.get_siblings(a) | ||
def joined(self, a, b): | ||
star1327p marked this conversation as resolved.
Show resolved
Hide resolved
|
||
""" | ||
Return whether *a* and *b* are members of the same set. | ||
""" | ||
return self._grouper.joined(a, b) | ||
def get_siblings(self, a): | ||
star1327p marked this conversation as resolved.
Show resolved
Hide resolved
|
||
""" | ||
Return all of the items joined with *a*, including itself. | ||
""" | ||
return self._grouper.get_siblings(a) | ||
|
||
|
||
def simple_linear_interpolation(a, steps): | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 change is not necessary, in fact the original one conforms to our style https://matplotlib.org/devdocs/devel/document.html#quote-positions. Please revert.
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.
@timhoffm I manually changed it back in comment 08982e9