We prefer a standard development method. To ensure this, this guide explains the development rules and instructions.
Source code is hosted at Github. Pull requests and issues are welcome. However, the following requirements need to be met:
Python codes and the variable’s name should follow PEP 8 standard. An automatic flake8 check is developed, and all pull requests needs to pass the check.
Expose APIs should have a docstrings to automatic generate API documents. docstrings should follow the Google Style Python Guide.
Methods, Classes needs to provide enough tests (using pytest), and all tests needs to pass the automatic check in pull requests.
Develop and Compile Instruction
SimQN is a Python library for quantum networks evaluation. It requires Python > 3.7.0. WE leverage setuptools to build SimQN:
pip3 install setuptools wheel twine pip3 install -r requirements
To setup the development environments, the following command install SimQN into the python library so that we can do import qns:
python3 setup.py develop
To compile and build a SimQN package, we can use:
python3 setup.py bdist_wheel
Now the SimQN package is qns-<version>-py3-none-any.whl in dist directory. To further install this package, you can use pip:
pip3 install qns-<version>-py3-none-any.whl
Compile API documents
We adopt sphinx to build our documents, and the first thing is to install it:
pip3 install sphinx sphinx_rtd_theme sphinx-autobuild
To automatic generate the API documents, use the following command:
sphinx-apidoc -o docs/source qns
To build document website, use the command:
Now, the compiled static website is built. Our documents is hosted on the gh-pages branch. Use the following command to publish new documents:
git subtree push --prefix docs/build/html origin gh-pages