Development¶
As an open-source project other researchers/students are encouraged to improve upon the code/documentation. The code is released under the permissive BSD 2-Clause License. The source code repository is found at https://github.com/chemreac/chemreac which is also where issues and patches (“pull requests”) are posted.
Coding standards¶
The Python code should comply with PEP8. PEP8 complience is also checked by the CI servers. For the C++ code, PyNE’s C/C++ style guide is recommended.
Documentation standard¶
The API docs are generated automatically and numpydoc is used to automatically parse docstrings of functions and classes. See the NumPy/SciPy documentation guide for more info.
Unit tests¶
The correctness of the implementation is verified through the use of (hundreds of) unit tests. Ideally all code should be covered with tests.
Continuous integration¶
In order to minimize the risk of (re)introducing bugs into the code base, it is continuously built on two CI services:
Above you can find the build status shield for travis-ci (Py 2.7, Py 3.4, no OpenMP, runs coveralls, builds docs and pushes them to the chemreac.github.io repo).
Above you can find build status shield for drone on hera.physchem.kth.se (Py 2.7, uses OpenMP and the Sundials backend, build docs as artifact, html coverage report as artifact, uses Docker image from script/docker_drone/Dockerfile)
Test coverage¶
Unit testing is a great tool, provided the tests actually cover the majority of the code base. In order to keep track of the coverage “coveralls” is used (click the badge above to see detailed per-line breakdown).
Environment¶
The documentation assumes a *NIX like environment, or at least familiarity with this environment for tweaking build scripts etc. Feedback from users and developers on other platforms is most welcome.
If you are new to github and the like, a good start is SymPy’s wiki entry on development workflow (minus the SymPy specific parts obviously).
Example of setting up a development environment¶
Here is an example to get you started developing chemreac and contributing to the code:
- Fork the repository on github
- Install the dependencies specified in the README.rst
- Clone your own repo to get a local copy:
$ git clone https://github.com/YOUR_GITHUB_USERNAME/chemreac.git
4. Set-up the pre-commit hook (prevents commiting untested code).
$ cd .git/hooks
$ ln -s ../../scripts/pre-commit.sh pre-commit
$ cd -
5. Create a new branch
$ git checkout -b fix_silly_bug
6. Edit files, add test(s), make sure all tests pass by running:
$ ./scripts/run_tests.sh
7. make a commit, and push your changes:
$ git commit -am "Fixed a silly bug in the complex-thingy."
$ git push
- Go to your forked repo on github and create a pull-request from there.