Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

API: Use class-based directive in sphinxext#13138

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
anntzer merged 4 commits intomatplotlib:masterfromlarsoner:plot_directive
Jan 10, 2019

Conversation

larsoner
Copy link
Contributor

PR Summary

Changesmatplotlib.sphinxext.plot_directive to 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 thematplotlib doc builds (assuming it's built by CI)!

I also added aversion to the.. plot:: config settings, and set to0.2 (previously was unset, so I assumed it to be0.1).

Closes#13132.

PR Checklist

  • Has Pytest style unit tests (implicitly any existing tests have been updated)
  • Code isFlake 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

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.md be 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.

@larsoner
Copy link
ContributorAuthor

CircleCI output looks reasonable onthis PR compared tomaster.

@@ -176,9 +177,10 @@

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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Use@cbook.deprecated("3.1", alternative="PlotDirective") to mark deprecation rather than editing the docstring (the decorator will edit it for you).


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),
Copy link
Contributor

Choose a reason for hiding this comment

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

would suggest just deleting it

@@ -273,7 +295,8 @@ def setup(app):

app.connect('doctree-read', mark_plot_labels)

metadata = {'parallel_read_safe': True, 'parallel_write_safe': True}
metadata = {'parallel_read_safe': True, 'parallel_write_safe': True,
'version': 0.2}
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems better to just track the matplotlib version here.

@tacaswelltacaswell added this to thev3.1 milestoneJan 10, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@anntzeranntzeranntzer left review comments

@tacaswelltacaswelltacaswell approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.1.0
Development

Successfully merging this pull request may close these issues.

3 participants
@larsoner@tacaswell@anntzer

[8]ページ先頭

©2009-2025 Movatter.jp