Skip to content

Latest commit

 

History

History
84 lines (64 loc) · 2.27 KB

CONTRIBUTING.md

File metadata and controls

84 lines (64 loc) · 2.27 KB

Contribution guidelines

Installation and Development

Clone from github:

git clone git@github.com:CitrineInformatics/dft-input-gen.git

Create a virtual environment; one option is to use conda, but it is not required:

conda create -n <env_name>
conda activate <env_name>

Then install requirements:

pip install -U -r requirements.txt
pip install -U -r test_requirements.txt
pip install --no-deps -e .

Running tests

We use pytest to run tests. To run all tests:

pytest -svv

Test coverage

We use pytest-cov to check code coverage. To run all tests and output a report of the coverage of the src directory:

pytest --cov=src/ --cov-report term-missing -svv

Coding Style

dftinputgen follows PEP8, with several docstring rules relaxed. See tox.ini for a list of the ignored rules. Docstrings must follow the Numpy style.

We use flake8 as a linter. To run the linter on the src directory:

flake8 src

A pre-commit hook is available to auto-format code with black (recommended):

  1. Make sure you are using a Python version >=3.6
  2. Install black: $ pip install black
  3. Install pre-commit: $ pip install pre-commit
  4. Intall git hooks in your .git directory: $ pre-commit install

PR Submission

dftinputgen follows the gitflow workflow, so all PRs must be submitted to the develop branch. Versions must follow semantic versioning.

In order to be merged, a PR must be approved by one authorized user and the build must pass. A passing build requires the following:

  • All tests pass
  • The linter finds no violations of PEP8 style
  • Every line of code is executed by a test (100% coverage)

It is recommended to complement any new large module(s) with example(s) in the dftinputgen.demo module.

Documentation

Additional information useful to the user should be added to the package documentation in docs/src.