-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Improve docstrings in offsetbox.py #16085
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
9736069
to
0ef661a
Compare
0ef661a
to
779e3ea
Compare
lib/matplotlib/offsetbox.py
Outdated
@@ -1245,6 +1279,9 @@ def _get_anchored_bbox(self, loc, bbox, parentbbox, borderpad): | |||
class AnchoredText(AnchoredOffsetbox): | |||
""" | |||
AnchoredOffsetbox with Text. | |||
|
|||
This is a convenience class. Technically, it is just an `AnchoredOffsetbox` | |||
containing a `TextArea`. |
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.
last sentence basically duplicates the first line...
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.
The first line gives the intent of the class. The last sentence describes how it it realized. I think both are helpful.
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.
Something like
Convenience subclass of `AnchoredOffsetbox` for holding a `TextArea`.
would be enough, and fit in one line?
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 don't think that catches the essence. From the outside it's really created like a text object: the text s
is the first parameter. Only if I'm to operate on it further, it helps to know that it's ans AnchoredOffsetbox
containing a TextArea
.
If you strictly want a single line, I'd rather go back to the original docstring.
TBH, I don't really understand all this offsetbox business. Maybe it's just a lack of documentation, but it feels overly complicated for what it's trying to achieve.
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 don't understand it completely either, but I think I would rather leave things as is and first clarify the actual intent.
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.
Reverted for now. Thanks for the discussion.
Looks like you messed up your rebase. |
2ff768e
to
feb4b75
Compare
feb4b75
to
4593c03
Compare
4593c03
to
c0a5864
Compare
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.
postci
@timhoffm I'll let you squash-merge? (or just merge if you really want both commits) |
PR Summary