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

FIX: errors in get_position changes#12363

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

Conversation

jklymak
Copy link
Member

@jklymakjklymak commentedOct 1, 2018
edited
Loading

PR Summary

Closes#12355

This corrects a few mistakes in positioning PRs that were preventing locatable axes from working correctly. It also makes a couple of kwargs explicit rather than positional when we call them.

PR Checklist

  • Has Pytest style unit tests
  • Code isFlake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@ImportanceOfBeingErnest
Copy link
Member

Maybe this is a good place to add a test forthe failing usecase?

jklymak reacted with thumbs up emoji

@jklymak
Copy link
MemberAuthor

New test fails master, passes this PR and was the root of the problem....

@jklymakjklymak added this to thev3.0.x milestoneOct 2, 2018
@jklymakjklymakforce-pushed thefix-correct-get-position-errors branch from59a994b toa5e6667CompareOctober 2, 2018 15:44
@jklymakjklymak added Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. status: needs review labelsOct 2, 2018
@timhoffm
Copy link
Member

timhoffm commentedOct 3, 2018
edited
Loading

Please rebase.#12366 is in and should fix the failing CI.

@jklymak
Copy link
MemberAuthor

...rebased

@timhoffm
Copy link
Member

flake8 says

./lib/mpl_toolkits/tests/test_axes_grid1.py:399:57: W291 trailing whitespace

@jklymakjklymakforce-pushed thefix-correct-get-position-errors branch from0ce489c to1da1c35CompareOctober 3, 2018 17:49
@jklymak
Copy link
MemberAuthor

Fixed flake8. I'd actually be in favour of adding an Exception for the trailing whitespace error.

Copy link
Member

@WeatherGodWeatherGod left a comment

Choose a reason for hiding this comment

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

everything else looks good, just have a comment about a code alignment.

@@ -2298,7 +2298,8 @@ def get_tightbbox(self, renderer, bbox_extra_artists=None):

for ax in self.axes:
if ax.get_visible():
bb.append(ax.get_tightbbox(renderer, bbox_extra_artists))
bb.append(ax.get_tightbbox(renderer,
bbox_extra_artists=bbox_extra_artists))
Copy link
Member

Choose a reason for hiding this comment

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

The alignment of this keyword argument makes me think it is for the append, not the get_tightbbox(), but even that looks wonky. Which PEP8 alignment rule is this?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I just did two-tab (8-space) indentation - I don't think it'll fit on one line, though I can check

Copy link
Member

Choose a reason for hiding this comment

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

It will not, nor will it work with aligning to the correct opening parenthesis, but you can do this:

bb.append(ax.get_tightbbox(renderer,bbox_extra_artists=bbox_extra_artists))

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Ummm, OK, butreally the 8-space indent is allowed by PEP8, and in this case I think looks best:

https://www.python.org/dev/peps/pep-0008/?#indentation

Copy link
Member

Choose a reason for hiding this comment

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

I'm meant "will not fit", not anything about whether it's in PEP8.

Copy link
Member

Choose a reason for hiding this comment

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

That PEP8 link uses 4-space indent for continuation lines; it's only if there's ambiguity that double indent is used (but keep in mind there are no nested function calls in those examples.)

Copy link
Member

Choose a reason for hiding this comment

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

I think a list comprehension would be more readable anyway.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

OK, list comprehension is bearable.

Copy link
Contributor

Choose a reason for hiding this comment

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

Uh, I think (hope?)@timhoffm meant something like

        bbox.extend(            ax.get_tightbbox(renderer, bbox_extra_artists=bbox_extra_artists)            for ax in self.axes if ax.get_visible())

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Fine

for ax in self.parasites]
bbs.append(super().get_tightbbox(renderer, call_axes_locator))
bbs.append(super().get_tightbbox(renderer,
call_axes_locator=call_axes_locator))
Copy link
Member

Choose a reason for hiding this comment

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

similar issue here, the alignment of the keyword argument is wonky.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Fixed

@jklymakjklymakforce-pushed thefix-correct-get-position-errors branch 2 times, most recently froma518ddf tod4c7069CompareOctober 4, 2018 14:58
@jklymakjklymakforce-pushed thefix-correct-get-position-errors branch fromd4c7069 to78db75fCompareOctober 4, 2018 15:15
@@ -327,9 +327,10 @@ def _remove_method(h):
return ax2

def get_tightbbox(self, renderer, call_axes_locator=True):
bbs = [ax.get_tightbbox(renderer, call_axes_locator)
bbs = [ax.get_tightbbox(renderer, call_axes_locator=call_axes_locator)
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see how this change is needed? (doesn't hurt, but still?)

@jklymakjklymak mentioned this pull requestOct 12, 2018
@tacaswelltacaswell merged commitff53308 intomatplotlib:masterOct 12, 2018
@lumberbot-app
Copy link

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
$ git checkout v3.0.x$ git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
$ git cherry-pick -m1 ff533081242308803ecdad75cd2539c999278e66
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
$ git commit -am 'Backport PR #12363: FIX: errors in get_position changes'
  1. Push to a named branch :
git push YOURFORK v3.0.x:auto-backport-of-pr-12363-on-v3.0.x
  1. Create a PR against branch v3.0.x, I would have named this PR:

"Backport PR#12363 on branch v3.0.x"

And apply the correct labels and milestones.

Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon!

If these instruction are inaccurate, feel free tosuggest an improvement.

jklymak pushed a commit to jklymak/matplotlib that referenced this pull requestOct 12, 2018
…tion-errorsFIX: errors in get_position changes
QuLogic added a commit that referenced this pull requestOct 13, 2018
@jklymakjklymak deleted the fix-correct-get-position-errors branchOctober 22, 2018 17:41
@jklymakjklymak added the topic: geometry managerLayoutEngine, Constrained layout, Tight layout labelOct 24, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@WeatherGodWeatherGodWeatherGod left review comments

@QuLogicQuLogicQuLogic left review comments

@anntzeranntzeranntzer left review comments

@timhoffmtimhoffmtimhoffm approved these changes

Assignees
No one assigned
Labels
Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.topic: geometry managerLayoutEngine, Constrained layout, Tight layout
Projects
None yet
Milestone
v3.0.1
Development

Successfully merging this pull request may close these issues.

Error for bbox_inches='tight' in savefig with make_axes_locatable
7 participants
@jklymak@ImportanceOfBeingErnest@timhoffm@WeatherGod@QuLogic@anntzer@tacaswell

[8]ページ先頭

©2009-2025 Movatter.jp