Skip to content

Fix WCSAxes bbox calculation - #10797

Merged
astrofrog merged 7 commits into
astropy:masterfrom
dstansby:wcsaxes-bbox
Oct 23, 2020
Merged

astrofrog merged 7 commits into
astropy:masterfrom
dstansby:wcsaxes-bbox

Conversation

@dstansby

@dstansby dstansby commented Oct 4, 2020 •

Copy link
Copy Markdown
Contributor

Fixes #10796.

This includes the axes bounding box in the caclulation; previously only the tick label bboxes were included.

@dstansby
dstansby marked this pull request as ready for review October 5, 2020 19:52
@dstansby

dstansby commented Oct 5, 2020

Copy link
Copy Markdown
Contributor Author

This was deceptively easy in the end, just needed to include the bbox of the actual axes instead of just the tick labels...

@pllim pllim added the Bug label Oct 5, 2020
@pllim pllim added this to the v4.0.2 milestone Oct 5, 2020
@pllim
pllim requested review from Cadair and astrofrog October 5, 2020 19:59
@pllim

pllim commented Oct 5, 2020 •

Copy link
Copy Markdown
Member

Needs a change log. I'll let reviewers decide if a test is necessary. Thanks!

@astrofrog astrofrog modified the milestones: v4.0.2, v4.0.3 Oct 10, 2020
@astrofrog

astrofrog commented Oct 13, 2020 •

Copy link
Copy Markdown
Member

Thank for the fix! It looks like no tests cover this line - though I suspect they do, but it might just be that we don't report coverage from CircleCI?

Could you add an explicit test of the bounding box, which isn't an image test?

@astrofrog astrofrog modified the milestones: v4.0.3, v4.0.4 Oct 14, 2020
@Cadair

Cadair commented Oct 14, 2020

Copy link
Copy Markdown
Member

The tests seem to be failing, otherwise looks good 👍

@astrofrog astrofrog left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! Just a small comment below.

Comment thread astropy/visualization/wcsaxes/tests/test_misc.py Outdated
@astrofrog

Copy link
Copy Markdown
Member

@dstansby - do you have time to wrap this up? It would be good to get this fix in!

@dstansby

Copy link
Copy Markdown
Contributor Author

Not really, if someone wants to finish it feel free. I think the outstanding issue is that the bbox calaculation is matplotlib version dependent, so the test should be pinned to and only run on a single version of matplotlib.

@Cadair
Cadair requested a review from astrofrog October 23, 2020 15:51
mpl_version = Version(matplotlib.__version__)
MATPLOTLIB_LT_21 = mpl_version < Version("2.1")
MATPLOTLIB_LT_22 = mpl_version < Version("2.2")
NOT_MATPLOTLIB_33 = mpl_version.major != 3 or mpl_version.minor != 3

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you make this MATPLOTLIB_33 and write not MATPLOTLIB_33 in the skipif below?

Comment thread astropy/visualization/wcsaxes/tests/test_misc.py Outdated
Comment thread astropy/visualization/wcsaxes/tests/test_misc.py Outdated

@astrofrog astrofrog left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, thanks @dstansby and @Cadair!

@astrofrog astrofrog added the zzz 💤 merge-when-ci-passes Do not use: We have auto-merge option now. label Oct 23, 2020
@astrofrog
astrofrog merged commit d246bc9 into astropy:master Oct 23, 2020
@dstansby
dstansby deleted the wcsaxes-bbox branch October 24, 2020 06:49
bsipocz pushed a commit that referenced this pull request Nov 6, 2020
astrofrog added a commit that referenced this pull request Nov 10, 2020
bsipocz pushed a commit that referenced this pull request Nov 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug visualization.wcsaxes zzz 💤 merge-when-ci-passes Do not use: We have auto-merge option now.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tight bounding box not calculated correctly for WCSAxes

4 participants