-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
removed deprecated methods from the axes module. #1568
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
Conversation
Unlike what I said, travis-ci tells me the tests don't pass... i'll have a closer look. |
I think that you will also want to use the new MatplotlibDeprecationWarning; I'm not sure whether it has been merged yet, but it is the way to go. |
It has not been merged yet. I'll update the PR once it is. |
@@ -6137,6 +6076,9 @@ def scatter(self, x, y, s=20, c='b', marker='o', cmap=None, norm=None, | |||
else: | |||
colors = mcolors.colorConverter.to_rgba_array(c, alpha) | |||
|
|||
# FIXME: faceted is deprecated but no warning is set when faceted is | |||
# manually set to True. | |||
# Moreover, is edgecolors 'none' and None different ? |
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, None means use the rcParams['patch.edgecolor'], but "none" means "don't color the edges at all".
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.
OK, good to now (I could have looked it up).
One way to fix the deprecation warning problem I mention just above would be to change the default value of faceted to spot when it is manually set to True, and raise the warning.
I'm not sure it is the best way to go, but that's the only thing my (very tired) brain is coming up with right now...
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.
@NelleV I think the thing to do here, after you have had a good rest, is to remove faceted from the listed kwargs. Then
faceted = kwargs.pop('faceted', None)
if faceted is not None:
# raise the deprecation warning...
# and set edgecolors as is already being done based on the value of faceted...
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.
It's done !
I'm now using the new matplotlib deprecation warning. |
if faceted is not None: | ||
raise MDeprecation("The faceted option is deprecated. " | ||
"Please use edgecolor instead. Will " | ||
"be remove in 1.4") |
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.
By raising here, this functionality is eliminated, there's no way for the code path to continue. So either keeps this as a warning, or raise with just "The faceted option is deprecated. Please use edgecolor instead."
I left a few comments inline, but wanted to add that since this now uses MatplotlibDeprecationWarning which currently lives in #1597, this PR should be merged after that one. |
I've updated this patch with the new interface. |
I think this is ready to be merged. |
@@ -7307,6 +7251,9 @@ def pcolor(self, *args, **kwargs): | |||
cmap = kwargs.pop('cmap', None) | |||
vmin = kwargs.pop('vmin', None) | |||
vmax = kwargs.pop('vmax', None) | |||
if 'shading' in kwargs: | |||
raise DeprecationWarning("Use edgecolors instead of shading. " |
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.
Shouldn't this be a mplDeprecation?
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.
Nice catch. I've fixed it.
…dWarnings in places where there should have been some
@dmcdougall Maybe you can have a look at this PR ? It should be quite staightforward and ready for merge. |
@NelleV Code style looks good, but Travis is legitimately failing. I will run the tests locally and try to help you through fixing the errors. |
if faceted: | ||
edgecolors = None | ||
else: | ||
edgecolors = 'none' |
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.
In the scatter
test, this code never gets executed and edgecolors
doesn't get set.
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've fixed the problem. I think there was a bug before, as edgecolors was always set from the argument faceted
, instead of being fetched from the kwargs.
I also think we need to consider moving it from kwargs to a named argument. What do you think?
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 that, to be consistent with the other pyplot functions, we should leave it as a kwarg and perhaps formulate an MEP to overhaul the kwargs if there is a consensus for that.
Ok, since that Thanks @NelleV. |
removed deprecated methods from the axes module.
This PR not only removes deprecated methods, but also add deprecated warnings for methods that were said as being deprecated, but no warning had ever been added.
All the tests pass.
Thanks,
N