Skip to content
Szymon Talaga edited this page Dec 29, 2018 · 1 revision

Contributor Guide

Collaboration & git workflow

The general idea is to separate ongoing work from the master branch (main development history). This will help ensuree that no accidental and unwanted changes will be pushed to overwrite the main codebase. Thus, a following workflow should be kept at all times:

  1. Start working on a new feature.
  2. Synchronize the local repository with the remote This is done usually by invoking: git pull --rebase origin <branch>, where <branch> is the name of a branch to which one synchronizes, usually this will be the master branch.
  3. Create a new branch for feature development with git checkout -b <branch name>.
  4. Work on a feature on the new branch and make as many commits as needed.
  5. When done, push the new branch to the repository and create a pull request. You can read more about pull requests here and here.
  6. The team discusses the propose changes and apply corrections and adjustments if needed.
  7. When everyone agree that the feature is ready, the new branch is merged with a target branch (usually the master branch) by the repository owner.

The above workflow is an example of shared repository approach. An alternative called fork-and-pull approach is based on everyone working on a completely separate forks of the main repository and doing between repository pull requests. This approach seems to be a little bit of an overkill for a team of few persons.

Static code analysis

At least for the beginnign let's try to keep to the PyLint configuration provided in the repo.

Unit testing

It is preferable, especially in the longterm, to follow the Test Driven Development approach. This is about writing modular code (decompose complicated logic into simple methods/functions) alongside with unit tests (simple automatically run functions that test the implementations).

PyTest is a very powerful and flexible library for unit testing, so it seems to be a good choice for this. It is quite complicated in advanced usecases, but standard usage is extremely simple. It also make benchmarking and profiling code very easy.

Documentation

I recommend to use the so-called Numpy style documentation. It makes it very easy to read docstrings in the source code and is not to hard to write (check the skeleton code of the BDM class). It can also utilize all the power of the reStructuredText markup.

Useful VS Code extensions

Here is a short list of extensions for the VS Code IDE, that are often useful:

Clone this wiki locally