Repository navigation
Fix issue in ndcube requiring changes in astropy - #15985
Conversation
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
There was a problem hiding this comment.
Welcome to Astropy 👋 and congratulations on your first pull request! 🎉
A project member will respond to you as soon as possible; in the meantime, please have a look over the Checklist for Contributed Code and make sure you've addressed as many of the questions there as possible.
If you feel that this pull request has not been responded to in a timely manner, please send a message directly to the development mailing list. If the issue is urgent or sensitive in nature (e.g., a security vulnerability) please send an e-mail directly to the private e-mail [email protected].
neutrinoceros
left a comment
There was a problem hiding this comment.
Your patch seems sound on the first look, however it doesn't look backward compatible yet as it's breaking some image comparison tests.
I was able to track down the reason why this happens: the WCSAxes.grid method sets show_grid=None by default (which is equivalent to False in contexts where it's interpreted as a boolean), whic gets passed down to CoordinateHelper.grid.
astropy/astropy/visualization/wcsaxes/core.py
Line 771 in 3d5aae9
I think you'll need to explicitly distinguish
draw_grid=False and draw_grid=None.
Your patch also makes it more evident that the visible keyword argument is silently dropped (which is already the case in the current version). It appears this quirk emerged as matplotlib's API evolved (the same parameter used to be called b and renamed to visible) but derived classes in astropy didn't follow. That's a problem on in own so I'll probably just open a separate issue and we don't need to fix it here, but I want to thank you for making me realise this !
…separately and separately
|
I have handled the case of |
|
Thank you ! it's still failing though, so there's more to it than I thought, sorry ! |
|
The failures look related. Either the "truths" been wrong all this time or this patch is incorrect. cc @astrofrog @Cadair @dstansby |
neutrinoceros
left a comment
There was a problem hiding this comment.
Thanks for fixing tests !
I think we should also add a new one to prevent regressions, and a changelog entry is also needed to merge this !
|
I have added the changelog, reorganized the patch, and included the regression test as requested.(I think I'll need more time to properly write the test ) |
a859cae to
06151f6
Compare
Perhaps you forgot to push those additions out? I do not see any change log or test. Also please refrain from pushing your commits out one by one. I would encourage you to test your fix locally first. Thanks! |
|
Yes, will do |
|
For a change that is only |
|
I understand , appreciate your guidance! |
Co-authored-by: Clément Robert <[email protected]>
|
pre-commit.ci autofix |
|
@neutrinoceros, would you mind taking a look at the recent changes? Thank you! |
Co-authored-by: Clément Robert <[email protected]>
|
Thank you for guiding me through the process. |
|
No problem ! |
neutrinoceros
left a comment
There was a problem hiding this comment.
let me re-approve this
Co-authored-by: P. L. Lim <[email protected]>
* Fix issue in ndcube requiring changes in astropy * Fix issue in ndcube (required changes in astropy)Handled the case of separately and separately * Fix issue in ndcube (required changes in astropy) * Fix issue in ndcube (required changes in astropy) * Restructured the patch * Add changlog and regression test * Update docs/changes/visualization/15985.bugfix.rst Co-authored-by: Clément Robert <[email protected]> * Corrected edge case * Modified tests for my patch * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update docs/changes/visualization/15985.bugfix.rst Co-authored-by: Clément Robert <[email protected]> * Removed the case where draw_grid value is invalid * Update docs/changes/visualization/15985.bugfix.rst Co-authored-by: P. L. Lim <[email protected]> --------- Co-authored-by: Clément Robert <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: P. L. Lim <[email protected]> Co-authored-by: Stuart Mumford <[email protected]>
Please use SQUASH AND MERGE button if we decide to merge. Thanks!
Description
This pull request address issue sunpy/ndcube#426 of the ndcube repo in Sunpy Organisation,
Issue link: sunpy/ndcube#426
Describe issue:
When an instance of Coordinatehelper class is created passing draw_grid=False to the associate coordinate helpers from the axes instance emitted by plot() is ignored.
The solution:
Requires re-structuring of code in coordinate_helpers.py so that all the cases for draw_grid is met