Improve deprecation documentation. Closes #7643 #7646

Merged
merged 3 commits into from Dec 20, 2016

Conversation

Projects
None yet
4 participants
Contributor

ngoldbaum commented Dec 20, 2016

This improves the deprecation warnings printed by axes.hold and plt.hold and adds a mention of the deprecation of the spectral colormap to the API changes document.

ngoldbaum added some commits Dec 20, 2016

@ngoldbaum ngoldbaum Tweak the deprecation warning for pyplot.hold 49ed95d
@ngoldbaum ngoldbaum Improve the deprecation warning for axes.hold 9af2990
@ngoldbaum ngoldbaum Mention the deprecation of the spectral colormap in the api_changes doc
b0618d8

NelleV changed the title from Improve deprecation documentation. Closes #7643 to [MRG+1] Improve deprecation documentation. Closes #7643 Dec 20, 2016

Contributor

NelleV commented Dec 20, 2016

LGTM. Thanks for the patch!

@NelleV

NelleV approved these changes Dec 20, 2016

Owner

efiring commented Dec 20, 2016

My reading of the deprecation decorator code is that if you want to use your own message, you would normally include some format strings. At present I think your PR is discarding the version information.

Actually, it looks to me like the underlying _generate_deprecation_message is broken by indentation errors, at the very least... It is not doing the substitutions it should if a message is given.

Contributor

NelleV commented Dec 20, 2016

@efiring There are two deprecation messages. Which one are you talking about?

Owner

efiring commented Dec 20, 2016

Both of them. Same problem. The first one could be helpful if it included the necessary format strings, and if the _generate_deprecation_message bug were fixed. The second one is pointless, providing less information than what it replaces.

Contributor

NelleV commented Dec 20, 2016

The deprecation messages don't strike me as being less informative. IMO, it is quite the opposite.

Owner

efiring commented Dec 20, 2016

@NelleV you are correct; given that the decorator replaces the default message with the one supplied as an argument, ignoring all other arguments, this PR does provide more information. I had an incorrect expectation of what the decorator would do in this case. (Nevertheless, it is broken in that it can't presently be used as intended, taking advantage of its arguments via format strings in the message).

Contributor

ngoldbaum commented Dec 20, 2016

Yes, I noticed last night that the format string magic wasn't working.

Owner

tacaswell commented Dec 20, 2016

appveyor failure looks transient.

@tacaswell tacaswell merged commit c34ddc4 into matplotlib:master Dec 20, 2016

2 of 3 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.0007%) to 62.062%
Details

@tacaswell tacaswell added a commit that referenced this pull request Dec 20, 2016

@tacaswell tacaswell Merge pull request #7646 from data-exp-lab/improve-depr
DOC: Improve deprecation documentation (hold and spectral)

Closes #7643
4f0d2ee
Owner

tacaswell commented Dec 20, 2016

Thanks @ngoldbaum !

backported to v2.x as 4f0d2ee

Owner

efiring commented Dec 20, 2016

See also #7651.

QuLogic changed the title from [MRG+1] Improve deprecation documentation. Closes #7643 to Improve deprecation documentation. Closes #7643 Dec 26, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment