Developer guide

Source code is available at Github and can be cloned via git:

git clone ~/dicomweb-client

The dicomweb_client package can be installed in develop mode for local development:

pip install -e ~/dicomweb-client

Pull requests

Don’t commit code changes to the master branch. New features should be implemented in a separate branch called feature/* and bug fixes should be applied in separate branch called bugfix/*.

Before creating a pull request on Github, read the coding style guideline, run the tests and check PEP8 compliance.

Coding style

Code must comply with PEP 8. The flake8 package is used to enforce compliance.

The project uses numpydoc for documenting code according to PEP 257 docstring conventions. Further information and examples for the NumPy style can be found at the NumPy Github repository and the website of the Napoleon sphinx extension.

All API classes, functions and modules must be documented (including “private” functions and methods). Each docstring must describe input parameters and return values. Types must be specified using type hints as specified by PEP 484 (see typing module) in both the function definition as well as the docstring.

Running tests

The project uses pytest to write and runs unit tests. Tests should be placed in a separate tests folder within the package root folder. Files containing actual test code should follow the pattern test_*.py.

Install requirements:

pip install -r ~/dicomweb-client/requirements_test.txt

Run tests (including checks for PEP8 compliance):

cd ~/dicomweb-client
pytest --flake8

Building documentation

Install requirements:

pip install -r ~/dicomweb-client/requirements_docs.txt

Build documentation in HTML format:

cd ~/dicomweb-client
sphinx-build -b html docs/ docs/build/

The built index.html file will be located in docs/build.