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

Skip to content

Minor cleanups to pyplot. #11205

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 1 commit into from
May 9, 2018
Merged

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented May 9, 2018

The use of inspect.cleandoc instead of str.strip() in
_setup_pyplot_info_docstrings correctly dedents the docstring in the
case the first "sentence" spreads over 2+ lines (e.g. for
install_repl_displayhook).

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 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

@anntzer anntzer added this to the v3.0 milestone May 9, 2018
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.

Two minor things. I'll approve beforehand in the hope that you will handle them reasonably.

@@ -121,8 +122,7 @@ def install_repl_displayhook():
Install a repl display hook so that any stale figure are automatically
redrawn when control is returned to the repl.

This works with IPython terminals and kernels,
as well as vanilla python shells.
This works with both with IPython and with vanilla python shells.
Copy link
Member

Choose a reason for hiding this comment

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

Not a language expert, but this feels doubled. Either "This works with IPython and with vanilla python shells." or "This works with both IPython and vanilla python shells."

lines.append(sep)

lines = [
sep,
Copy link
Member

Choose a reason for hiding this comment

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

A bit niggling, but I like readable names. 😄. Can we make it separator or even table_separator?

The use of inspect.cleandoc instead of str.strip() in
_setup_pyplot_info_docstrings correctly dedents the docstring in the
case the first "sentence" spreads over 2+ lines (e.g. for
install_repl_displayhook).
@anntzer anntzer force-pushed the pyplot-cleanups branch from 011389b to 8ae35fe Compare May 9, 2018 19:27
@anntzer
Copy link
Contributor Author

anntzer commented May 9, 2018

both fixed

@jklymak jklymak merged commit 4d1ca36 into matplotlib:master May 9, 2018
@anntzer anntzer deleted the pyplot-cleanups branch May 9, 2018 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants