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

Remove contour warning for "no-valid-levels". #24912

Merged
merged 1 commit into from
Jan 12, 2023
Merged

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Jan 9, 2023

If the user explicitly passes a levels array (the default is auto-determined), let's assume that they know what they are doing. Closes #23778.

(I could consider keeping the warning for now in the case where the user didn't pass levels but z is uniform throughout, as that's more likely to be a "data-exploration" case.)

PR Summary

PR Checklist

Documentation and Tests

  • Has pytest style unit tests (and pytest passes)
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • New plotting related features are documented with examples.

Release Notes

  • New features are marked with a .. versionadded:: directive in the docstring and documented in doc/users/next_whats_new/
  • API changes are marked with a .. versionchanged:: directive in the docstring and documented in doc/api/next_api_changes/
  • Release notes conform with instructions in next_whats_new/README.rst or next_api_changes/README.rst

If the user explicitly passes a levels array (the default is
auto-determined), let's assume that they know what they are doing.
@rcomer
Copy link
Member

rcomer commented Jan 9, 2023

This also closes #20203.

@oscargus
Copy link
Member

oscargus commented Jan 9, 2023

Is this comment from @ianthomas23 dealt with?

"We should probably add a check for no levels specified by the user for a contour call, as already happens for contourf."

@anntzer
Copy link
Contributor Author

anntzer commented Jan 9, 2023

I'm not sure what this really means, but if it's adding a check for levels=[], I'd say that's again something explicitly asked by the user and we should not warn (just like we don't warn for plot([], [])).

@ianthomas23
Copy link
Member

My comment meant that if there is an explicit check for user-specified levels for a contourf call, there should be a similar check for a contour call so that the checks are consistent. But as you are removing the contourf check then that makes them consistent too, as neither checks.

@tacaswell tacaswell modified the milestones: v3.9.0, v3.8.0 Jan 9, 2023
Copy link
Member

@oscargus oscargus left a comment

Choose a reason for hiding this comment

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

I see the point of:

(I could consider keeping the warning for now in the case where the user didn't pass levels but z is uniform throughout, as that's more likely to be a "data-exploration" case.)

but do not have strong opinions enough to claim that it should be there. Seems like a quite safe option though.

@anntzer
Copy link
Contributor Author

anntzer commented Jan 10, 2023

Let's see what others think here.

Copy link
Member

@tacaswell tacaswell left a comment

Choose a reason for hiding this comment

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

I'm in favor of removing this warning and if we get reports of "all constant and no lines" we can consider putting the warning back in the fully automatic case (and it would make sense to check on the "all constant" case explicitly).

@anntzer
Copy link
Contributor Author

anntzer commented Jan 11, 2023

Sounds good; this is good to go, then?

@oscargus oscargus modified the milestones: v3.8.0, v3.7.0 Jan 12, 2023
@oscargus
Copy link
Member

Let's get this in for 3.7.

@oscargus oscargus merged commit 018c5ef into matplotlib:main Jan 12, 2023
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Jan 12, 2023
@anntzer anntzer deleted the cw branch January 12, 2023 23:07
oscargus added a commit that referenced this pull request Jan 12, 2023
…912-on-v3.7.x

Backport PR #24912 on branch v3.7.x (Remove contour warning for "no-valid-levels".)
@ksunden ksunden mentioned this pull request Feb 20, 2023
6 tasks
@rcomer rcomer mentioned this pull request Mar 8, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants