Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Remove (some) features deprecated in mpl2.2 #12245

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

Merged
merged 6 commits into from
Jan 7, 2019
Merged

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Sep 24, 2018

PR Summary

@dstansby gets to do mlab in #12165 :)

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@dstansby dstansby added this to the v3.1 milestone Sep 24, 2018
``GridSpecFromSubplotSpec.get_subplot_params``,
- svgfont support (in :rc:`svg.fonttype`),
- passing 'box-forced' to `axes.Axes.set_adjustable`,
- support for the strings 'on'/'true'/'off'/'false' to mean True/False.
Copy link
Member

Choose a reason for hiding this comment

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

I think the methods this affects should be listed here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Member

@dstansby dstansby left a comment

Choose a reason for hiding this comment

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

Having just spend ages trying to work out how to replace deprecated code in another project, I think all the deprecations here should have clear alternatives in the api_changes file where appropriate; I'm happy to work on this and push to this branch @anntzer?

@anntzer
Copy link
Contributor Author

anntzer commented Sep 27, 2018

Go for it.

@dstansby dstansby self-assigned this Sep 27, 2018
@@ -6255,8 +6255,7 @@ def table(self, **kwargs):
def hist(self, x, bins=None, range=None, density=None, weights=None,
cumulative=False, bottom=None, histtype='bar', align='mid',
orientation='vertical', rwidth=None, log=False,
color=None, label=None, stacked=False, normed=None,
**kwargs):
color=None, label=None, stacked=False, **kwargs):
Copy link
Member

Choose a reason for hiding this comment

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

Will this now just silently suck up normed into **kwargs, and not do anything? If so I think this removal needs a bit more thought (ie. maybe 1 or 2 releases that error when normed is passed).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I unremoved the normed kwargs. Feel free to handle its removal as you see fit.

@timhoffm
Copy link
Member

timhoffm commented Oct 7, 2018

I took the liberty to push more API-change notes. Each change should have an alternative given or stated that there is no alternative.

I'm ok with all the changes, but of course, cannot approve formally myself anymore because I've now code in this.

@anntzer
Copy link
Contributor Author

anntzer commented Nov 13, 2018

Rebased. @dstansby can you re-review?

Edit: Hmmmm sorry failing the tests now.

The update parameter control which parameter of the legend changes
when dragged. If update is "loc", the *loc* parameter of the legend
is changed. If "bbox", the *bbox_to_anchor* parameter is changed.
"""
Copy link
Member

Choose a reason for hiding this comment

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

Just a comment here... this docstring was never updated to note the deprecation, which means one would not know of the deprecation until they actually use the method. That seems sub-optimal.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But if someone is not actually using the method, how are they bothered by the deprecation and removal?

``backend_bases.FigureManagerBase.show_popup`` (this never did anything)
- ``backend_wx.SubplotToolWx`` (no replacement)
- ``backend_wx.Toolbar`` (use ``backend_wx.NavigationToolbar2Wx`` instead)
- ``cbook.align_iterators`` (no replacment)
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps say "use pandas instead" or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you have a specific replacement in mind, please push it (or I can do it), but otherwise that seems a bit vague (at least I don't know what replacement you're thinking about).

@WeatherGod
Copy link
Member

I am not particularly enthused by the number of "no replacement" we are putting in the documentation. I feel like we need to at least throw a line to users for similar functionality, or a hint towards how to implement the missing feature themselves.

In addition, for future deprecations, I think we might want to have this sort of guidance documented at the time of deprecation, not at the time of removal. That way, people can know how to update their code at a normal cadence, rather than later (not saying that will always happen, but one can hope!)

@anntzer
Copy link
Contributor Author

anntzer commented Nov 13, 2018

a hint towards how to implement the missing feature themselves.

They can copy-paste the code from an old version of matplotlib.

@anntzer
Copy link
Contributor Author

anntzer commented Nov 15, 2018

test failures should be fixed now.

@dstansby dstansby dismissed their stale review November 15, 2018 12:31

Don't have time to look at this, but my earlier concerns have been fixed

@dstansby dstansby added status: needs rebase Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. labels Jan 1, 2019
@anntzer
Copy link
Contributor Author

anntzer commented Jan 1, 2019

rebased

@anntzer anntzer added Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. and removed Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. status: needs rebase labels Jan 1, 2019
@dstansby
Copy link
Member

dstansby commented Jan 4, 2019

Looks good to me, I just added a few words to the note about svg support to make it clearer 👍

@timhoffm
Copy link
Member

timhoffm commented Jan 5, 2019

Needs rebase to unbreak the doc builds (c.f. #13080).

@anntzer
Copy link
Contributor Author

anntzer commented Jan 5, 2019

done

Copy link
Member

@timhoffm timhoffm 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 bold and approve even though I pushed a commit. But that commit only documented some alternatives and added removed one now-unnecessary argument case.

@dstansby
Copy link
Member

dstansby commented Jan 7, 2019

Going to merge on the basis of two reviews and it's probably better to get this in sooner rather than later so people using the master branch can find any problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants