Skip to content
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

Catch when the annotate keyword for GenericMap.plot() is not boolean #7163

Merged
merged 1 commit into from Aug 25, 2023

Conversation

ayshih
Copy link
Member

@ayshih ayshih commented Aug 23, 2023

Twice in the past month, we've had a user call GenericMap.plot() assuming that the first argument as axes (e.g., my_map.plot(ax)), but the first argument is actually annotate. This can result in confusing plotting behavior or outright errors. This PR catches this common error.

In the future, we can switch GenericMap.plot() to accept keyword-only arguments, but that of course would be an API change, so can't be backported.

@ayshih ayshih added map Affects the map submodule Minor Change PR only needs one approval to merge backport 5.0 on-merge: backport to 5.0 labels Aug 23, 2023
@ayshih ayshih marked this pull request as ready for review August 23, 2023 15:57
@ayshih ayshih requested a review from a team as a code owner August 23, 2023 15:57
@dstansby
Copy link
Member

👍 to this, I opened a new issue to track making them keyword only

@dstansby dstansby merged commit 823cb82 into sunpy:main Aug 25, 2023
22 of 24 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/sunpy that referenced this pull request Aug 25, 2023
@ayshih ayshih deleted the nonboolean_annotate branch October 25, 2023 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 5.0 on-merge: backport to 5.0 map Affects the map submodule Minor Change PR only needs one approval to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants