Skip to content

Latest commit

 

History

History
88 lines (59 loc) · 3.02 KB

CONTRIBUTING.md

File metadata and controls

88 lines (59 loc) · 3.02 KB

Contributing to GerryChain

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.

How can I contribute?

Reporting bugs

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.

Updating documentation

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.

Suggesting enhancements

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.

Contributing code (pull requests)

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.

Style Guides

Git commit messages

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.

Python styleguide

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), not f( x ).
    • array[x], not array[ x ].
    • if x == 1: print(x), not if x == 1 : print(x).
  • Do use whitespace around arithmetic operators:

    • 2 + 2, not 2+2
    • x / y, not x/y.
  • Write comments as complete sentences with correct punctuation and grammar.

  • Write docstrings in reStructuredText and in accordance with PEP257.