8000 DOC : whole bunch of documentation clean up by tacaswell · Pull Request #3170 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

DOC : whole bunch of documentation clean up #3170

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

Closed
wants to merge 20 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
DOC : minor tweaks to coding_guide
 - strengthen suggestion to use auto pep8 checker
 - added example  minimal numpydoc docstring
  • Loading branch information
tacaswell committed Jul 18, 2014
commit 050f3af6e4231db51e3d8a26b60c2c5ffdaf6e9f
38 changes: 32 additions & 6 deletions doc/devel/coding_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ Style
<http://www.python.org/dev/peps/pep-0008/>`_. Exceptions to these
rules are acceptable if it makes the code objectively more readable.

- You may want to consider installing automatic PEP8 checking in
your editor.
- You should installing/enabling automatic PEP8 checking in your
Copy link
Member

Choose a reason for hiding this comment

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

You should consider....

editor. Part of the test suite in checking PEP8 compliance, things
go smoother if the code is mostly PEP8 compliant to begin with.

* No tabs (only spaces). No trailing whitespace.

Expand Down Expand Up @@ -63,18 +64,43 @@ Documentation
-------------

* Every new feature should be documented. If it's a new module, don't
forget to add it to the API docs.
forget to add a new rst file to the API docs.

* Docstrings should be in `numpydoc format
<https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt>`_.
Don't be thrown off by the fact that many of the existing docstrings
are not in that format. We are working to standardize on
`numpydoc`.

Docstrings should look like (at a minimum)::
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add a link to the numpy doc format documentation?

Copy link
Member Author

Choose a reason for hiding this comment

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

There is already a link just out of the diff range


def foo(bar, baz=None):
"""
This is a prose description of foo and all the great
things it does.

Parameters
----------
bar : (type of bar)
A description of bar

baz : (type of baz), optional
A description of baz

Returns
-------
foobar : (type of foobar)
A description of foobar
foobaz : (type of foobaz)
A description of foobaz
"""
# some very clever code
return foobar, foobaz
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 this entire block above needs to be indented, doesn't it?

Copy link
Member

Choose a reason for hiding this comment

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

Nope

Copy link
Member

Choose a reason for hiding this comment

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

Sorry… Yes, it isn't aligned with "This" and "things"

Copy link
Member Author

Choose a reason for hiding this comment

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

turns out there were tabs in there....


* Each high-level plotting function should have a simple example in
the `Example` section. This should be as simple as possible to
demonstrate the method. More complex examples should go in the
`examples` tree.
the `Example` section of the docstring. This should be as simple as
possible to demonstrate the method. More complex examples should go
in the `examples` tree.

* Build the docs and make sure all formatting warnings are addressed.

Expand Down
0