Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Document and test _get_packed_offsets()#14516

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
timhoffm merged 5 commits intomatplotlib:masterfromtimhoffm:get-packed-offsets
Jun 25, 2019

Conversation

timhoffm
Copy link
Member

PR Summary

Properly test and documentmatplotlib.offsetbox._get_packed_offsets().

PR Checklist

  • Has Pytest style unit tests
  • Code isFlake 8 compliant
  • Documentation is sphinx and numpydoc compliant

@@ -81,6 +117,9 @@ def _get_packed_offsets(wd_list, total, sep, mode="fixed"):
elif mode == "equal":
maxh = max(w_list)
if total is None:
if sep is None:
raise ValueError("total and sep cannot both be None when "
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

This raised a TypeError before in the line below (int + None).

Since the function is private, we can do the change without announcement.

Co-Authored-By: Elliott Sales de Andrade <quantum.analyst@gmail.com>
@@ -123,4 +125,58 @@ def test_get_packed_offsets(wd_list, total, sep, mode):
# issue tickets (at least #10476 and #10784) related to corner cases
# triggered inside this function when calling higher-level functions
# (e.g. `Axes.legend`).
# These are just some additional smoke tests. The output is untested.
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this test could just be deleted as it is essentially covered by the tests below?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Not exactly, e.g. I do not test negativetotal orsep. I agree that they'd better be tested explicitly for their output, but until then this is better than nothing.

Since it is not documented whatshould happen in this cases, I've left this as is (unresolved). IMHO that discussion is worth some thought and a separate PR.

Copy link
Member

@QuLogicQuLogic left a comment

Choose a reason for hiding this comment

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

Feel free to merge when fixed.

----------
wd_list : list of (float, float)
(width, xdescent) of boxes to be packed.
total : float or None
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
total :floatorNone
total :floator*None*

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Generally, I don't think we style parameter types.

timhoffmand others added3 commitsJune 24, 2019 19:52
Co-Authored-By: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Co-Authored-By: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Co-Authored-By: Elliott Sales de Andrade <quantum.analyst@gmail.com>
@timhoffmtimhoffm merged commit896fb81 intomatplotlib:masterJun 25, 2019
@timhoffmtimhoffm deleted the get-packed-offsets branchJune 25, 2019 22:25
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@QuLogicQuLogicQuLogic approved these changes

@anntzeranntzeranntzer approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.2.0
Development

Successfully merging this pull request may close these issues.

3 participants
@timhoffm@QuLogic@anntzer

[8]ページ先頭

©2009-2025 Movatter.jp