-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Silence plot warnings #4365
Silence plot warnings #4365
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks @mathause
@@ -291,6 +291,11 @@ def _determine_cmap_params( | |||
cmap, newnorm = _build_discrete_cmap(cmap, levels, extend, filled) | |||
norm = newnorm if norm is None else norm | |||
|
|||
# vmin & vmax needs to be None if norm is passed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we can cleanup this function a bit by always returning a norm with vmin, vmax specified. But that can be a future PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that would be nice. I did not know which the default norm would be...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the default is mpl.colors.Normalize
.
Nice! Thanks a lot @mathause |
the upstream-dev CI failure seems to be caused by |
I switched to I'll leave the |
Thanks @mathause |
isort . && black . && mypy . && flake8
whats-new.rst
I gave a try to silence some of the warning for the plotting functions. I brought it down from 67 to 5 (4 of which come from external libraries).
MatplotlibDeprecationWarning: The 'extend' parameter to Colorbar has no effect because it is overridden by the mappable; it is deprecated since 3.3 and will be removed two minor releases later.
MatplotlibDeprecationWarning: You are modifying the state of a globally registered colormap. In future versions, you will not be able to modify a registered colormap in-place. To remove this warning, you can make a copy of the colormap first. cmap = copy.copy(mpl.cm.get_cmap("viridis"))
MatplotlibDeprecationWarning: Passing parameters norm and vmin/vmax simultaneously is deprecated since 3.3 and will become an error two minor releases later. Please pass vmin/vmax directly to the norm when creating it.
MatplotlibDeprecationWarning: shading='flat' when X and Y have the same dimensions as C is deprecated since 3.3. Either specify the corners of the quadrilaterals with X and Y, or pass shading='auto', 'nearest' or 'gouraud', or set rcParams['pcolor.shading']. This will become an error two minor releases later.
See plt.pcolormesh will infer interval breaks per default #4364UserWarning: Requested projection is different from current axis projection, creating new axis with requested projection.
I cannot exclude that one of these changes has an effect on the plots that is not tested in the suite... Tests pass locally for py38 and py36-bare-minimum.