Develop Guide ======================================= We prefer a standard development method. To ensure this, this guide explains the development rules and instructions. Code requirements --------------------------------------- Source code is hosted at `Github `_. Pull requests and issues are welcome. However, the following requirements need to be met: 1. 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. 2. Expose APIs should have a `docstrings` to automatic generate API documents. `docstrings` should follow the `Google Style Python Guide `_. 3. 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: .. code-block:: bash 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`: .. code-block:: bash python3 setup.py develop To compile and build a SimQN package, we can use: .. code-block:: bash python3 setup.py bdist_wheel Now the SimQN package is `qns--py3-none-any.whl` in `dist` directory. To further install this package, you can use `pip`: pip3 install qns--py3-none-any.whl Compile API documents ---------------------- We adopt `sphinx` to build our documents, and the first thing is to install it: .. code-block:: bash pip3 install sphinx sphinx_rtd_theme sphinx-autobuild To automatic generate the API documents, use the following command: .. code-block:: bash sphinx-apidoc -o docs/source qns To build document website, use the command: .. code-block:: bash cd docs make html Now, the compiled static website is built. Our documents is hosted on the `gh-pages` branch. Use the following command to publish new documents: .. code-block:: bash git subtree push --prefix docs/build/html origin gh-pages