Thank you for your interest in contributing to GerryChain! If you decide to participate, use this document as a guide for how to go about it. These are not strict rules; break them when appropriate.
If you find a bug while using any tools in this repository, consider creating a GitHub issue documenting the problem. Be sure to be detailed. Explain what you did, what you expected to happen, and what actually happened.
If you find any documentation that is lacking or in error, submit a pull request that updates it. Be sure to follow the documentation styleguide.
If you have ideas for additional features, consider creating a GitHub issue documenting the desired feature. Be sure to be detailed. Explain what the tool currently does (or does not do), what you would like it to do, and how this benefits users.
The main way to contribute code to the project is via GitHub pull requests (PRs). To create a pull request, see the GitHub docs. Be detailed in the description of your pull request. Explain what your proposed changes do, and reference any relevant issues.
Be sure to follow the style guides for code and documentation.
When writing git commit messages, use the following guidelines:
- Use the present tense ("Update documentation", not "Updated documentation")
- Use the imperative mood ("Fix import", not "Fixes import")
- Limit first line to 72 characters
For further guidelines, see this gist.
The recommended styleguide is PEP8, the Python standard. Using the source code linter flake8 will automatically scan your source code for compliance with PEP8.
Below are some highlights of PEP8, but refer to the standard itself for full details.
-
Use 4 spaces per indentation level.
-
Use spaces, not tabs.
-
Limit lines to 100 characters at maximum.
-
Avoid extraneous whitespace, such as in the following situations:
f(x)
, notf( x )
.array[x]
, notarray[ x ]
.if x == 1: print(x)
, notif x == 1 : print(x)
.
-
Do use whitespace around arithmetic operators:
2 + 2
, not2+2
x / y
, notx/y
.
-
Write comments as complete sentences with correct punctuation and grammar.
-
Write docstrings in reStructuredText and in accordance with PEP257.
- Docstrings are scanned by Sphinx to autogenerate documentation on our documentation site.