-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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
Changes from 1 commit
a727bdc
9e1c9cf
5f60a1e
0c85dfe
050f3af
6cfccbf
284135e
d11fc1a
9aa5f70
81e963b
23a63da
b1f0a60
b21e34d
5b613d4
ed65167
6d0503b
a9b25e1
6fcd723
a26114d
19e8ad1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- strengthen suggestion to use auto pep8 checker - added example minimal numpydoc docstring
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
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. | ||
|
||
|
@@ -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):: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe add a link to the numpy doc format documentation? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nope There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry… Yes, it isn't aligned with "This" and "things" There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should consider....