|
| 1 | +Contributing guide |
| 2 | +================== |
| 3 | + |
| 4 | + |
| 5 | +Getting started |
| 6 | +^^^^^^^^^^^^^^^ |
| 7 | + |
| 8 | +Contributing to scVelo requires a developer installation. As a first step, we suggest creating a new environment |
| 9 | + |
| 10 | +.. code:: bash |
| 11 | +
|
| 12 | + conda create -n ENV_NAME python=PYTHON_VERSION && conda activate ENV_NAME |
| 13 | +
|
| 14 | +
|
| 15 | +Following, fork the scVelo repo on GitHub `here <https://github.com/theislab/scvelo>`. |
| 16 | +If you are unsure on how to do so, please checkout the corresponding |
| 17 | +`GitHub docs <https://docs.github.com/en/github/getting-started-with-github/quickstart/fork-a-repo>`. |
| 18 | +You can now clone your fork of scVelo and install the development mode |
| 19 | + |
| 20 | +.. code:: bash |
| 21 | +
|
| 22 | + git clone https://github.com/YOUR-USER-NAME/scvelo.git |
| 23 | + cd scvelo |
| 24 | + git checkout --track origin/develop |
| 25 | + pip install -e '.[dev]' |
| 26 | +
|
| 27 | +The last line can, alternatively, be replaced by |
| 28 | + |
| 29 | +.. code:: bash |
| 30 | +
|
| 31 | + pip install -r requirements-dev.txt |
| 32 | +
|
| 33 | +
|
| 34 | +Finally, to make sure your code follows our code style guideline, install pre-commit: |
| 35 | + |
| 36 | +.. code:: bash |
| 37 | +
|
| 38 | + pre-commit install |
| 39 | +
|
| 40 | +
|
| 41 | +Coding style |
| 42 | +^^^^^^^^^^^^ |
| 43 | + |
| 44 | +Our code follows `black` and `flake8` coding style. Code formatting (`black`, `isort`) is automated through pre-commit hooks. In addition, we require that |
| 45 | + |
| 46 | +- functions are fully type-annotated. |
| 47 | +- variables referred to in an error/warning message or docstrings are enclosed in \`\`. |
| 48 | + |
| 49 | + |
| 50 | +Testing |
| 51 | +^^^^^^^ |
| 52 | + |
| 53 | +To run the implemented unit tests locally, simply run |
| 54 | + |
| 55 | +.. code:: bash |
| 56 | +
|
| 57 | + python -m pytest |
| 58 | +
|
| 59 | +
|
| 60 | +Documentation |
| 61 | +^^^^^^^^^^^^^ |
| 62 | + |
| 63 | +The docstrings of scVelo largely follow the `numpy`-style. New docstrings should |
| 64 | + |
| 65 | +- include neither type hints nor return types. |
| 66 | +- reference an argument within the same docstrings using \`\`. |
| 67 | + |
| 68 | + |
| 69 | +Submitting pull requests |
| 70 | +^^^^^^^^^^^^^^^^^^^^^^^^ |
| 71 | + |
| 72 | +New features and bug fixes are added to the code base through a pull request (PR). To implement a feature or bug fix, create a branch from `develop`. For hotfixes use `master` as base. The existence of bugs suggests insufficient test coverage. As such, bug fixes should, ideally, include a unit test or extend an existing one. Please ensure that |
| 73 | + |
| 74 | +- branch names have the prefix `feat/`, `bug/` or `hotfix/`. |
| 75 | +- your code follows the project conventions. |
| 76 | +- newly added functions are unit tested. |
| 77 | +- all tests pass locally. |
| 78 | +- if there is no issue solved by the PR, create one outlining what you try to add/solve and reference it in the PR description. |
0 commit comments