Skip to content
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

[MRG+1] Documentation on docstrings requirements #872

Merged
merged 9 commits into from
Mar 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
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
53 changes: 53 additions & 0 deletions docs/tutorials/contributing/strategy/docstrings.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Writing docstrings
==================

The project takes pride in its documentation for the strategies
and its corresponding bibliography. The docstring is a string
which describes a method, module or class. The docstrings help
the user in understanding the working of the strategy
and the source of the strategy. The docstring must be written in
the following way, i.e.::

"""This is a docstring.

It can be written over multiple lines.

"""

Sections
--------

The Sections of the docstring are:

1. **Working of the strategy**

A brief summary on how the strategy works, E.g.::

class TitForTat(Player):
"""
A player starts by cooperating and then mimics the
previous action of the opponent.
"""

2. **Bibliography/Source of the strategy**

A section to mention the source of the strategy
or the paper from which the strategy was taken.
The section must start with the Names section.
For E.g.::

class TitForTat(Player):
"""
A player starts by cooperating and then mimics the
previous action of the opponent.

Names:
- Rapoport's strategy: [Axelrod1980]_
- TitForTat: [Axelrod1980]_
"""

Here, the info written under the Names section
tells about the source of the TitforTat strategy.
`[Axelrod1980]_` corresponds to the bibliographic item in
`docs/reference/bibliography.rst`. If you are using a source
that is not in the bibliography please add it.
1 change: 1 addition & 0 deletions docs/tutorials/contributing/strategy/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Contents:

instructions.rst
writing_the_new_strategy.rst
docstrings.rst
adding_the_new_strategy.rst
classifying_the_new_strategy.rst
writing_test_for_the_new_strategy.rst
Expand Down