Repository navigation
API: Use class-based directive in sphinxext - #13138
Merged
Merged
Conversation
Contributor
Author
anntzer
reviewed
Jan 9, 2019
| def plot_directive(name, arguments, options, content, lineno, | ||
| content_offset, block_text, state, state_machine): | ||
| """Implementation of the ``.. plot::`` directive. | ||
| """Deprecated function-based implementation of the ``.. plot::`` directive. |
Contributor
There was a problem hiding this comment.
Use @cbook.deprecated("3.1", alternative="PlotDirective") to mark deprecation rather than editing the docstring (the decorator will edit it for you).
anntzer
reviewed
Jan 9, 2019
|
|
||
| app.add_directive('plot', plot_directive, True, (0, 2, False), **options) | ||
| # Old, function-based method was equivalent to: | ||
| # app.add_directive('plot', plot_directive, True, (0, 2, False), |
Contributor
There was a problem hiding this comment.
would suggest just deleting it
anntzer
reviewed
Jan 9, 2019
|
|
||
| metadata = {'parallel_read_safe': True, 'parallel_write_safe': True} | ||
| metadata = {'parallel_read_safe': True, 'parallel_write_safe': True, | ||
| 'version': 0.2} |
Contributor
There was a problem hiding this comment.
Seems better to just track the matplotlib version here.
tacaswell
approved these changes
Jan 10, 2019
5 tasks done
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
Changes
matplotlib.sphinxext.plot_directiveto use class-based mechanics instead of the deprecated function interface. I have verified building the SciPy doc looks the same before and after this change, and that having an error in the code emits the same warning/error in both cases. But I guess we'll see how thematplotlibdoc builds (assuming it's built by CI)!I also added a
versionto the.. plot::config settings, and set to0.2(previously was unset, so I assumed it to be0.1).Closes #13132.
PR Checklist
One question -- I put the API changes stuff in a new file because I assume it's going in the next release rather than 3.0.1. Should
.github/PULL_REQUEST_TEMPLATE.mdbe updated to mentiondoc/api/next_api_changes/instead ofdoc/api/api_changes.rst? If so I can add it here or make a new PR.