8000 DOC: Add docstrings to matplotlib.cbook.GrouperView by star1327p · Pull Request #29617 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

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 7 commits into from
Feb 14, 2025
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions lib/matplotlib/cbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Copy link
Member

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.

Copy link
Contributor Author

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

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.
"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above.

Copy link
Contributor Author

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

self._mapping.pop(a, {a}).remove(a)
self._ordering.pop(a, None)

Expand All @@ -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):

Check failure on line 887 in lib/matplotlib/cbook.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] reported by reviewdog 🐶 E301 expected 1 blank line, found 0 Raw Output: ./lib/matplotlib/cbook.py:887:5: E301 expected 1 blank line, found 0
"""
Return whether *a* and *b* are members of the same set.
"""
return self._grouper.joined(a, b)
def get_siblings(self, a):

Check failure on line 892 in lib/matplotlib/cbook.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] reported by reviewdog 🐶 E301 expected 1 blank line, found 0 Raw Output: ./lib/matplotlib/cbook.py:892:5: E301 expected 1 blank line, found 0
"""
Return all of the items joined with *a*, including itself.
"""
return self._grouper.get_siblings(a)


def simple_linear_interpolation(a, steps):
Expand Down
Loading
0