This is a technical guide for people already familiar with scientific Python software development. For an introduction to scientific Python software development, see Become a contributor.

Development guide


Atomap has a large number of unit tests, which are tested using pytest:

$ python3 -m pytest --doctest-modules atomap/

This also runs every docstring example as a unit test.

The documentation is tested by doing:

$ python3 -m pytest --doctest-glob="*.rst" doc/

Both the unit tests and the doc tests can be accelerated by running the tests in parallel. Use the xdist pytest package for this. To run the tests using 5 parallel processes:

$ python3 -m pytest -n 5 --doctest-modules atomap/
$ python3 -m pytest -n 5 --doctest-glob="*.rst" doc/

Style checks

In Atomap the PEP8 style guide is followed. To check style compliance use flake8:

$ python3 -m flake8 --exclude atomap/ atomap/

Generating the sphinx page

These documentation pages are written by using sphinx. You generate the html site by:

$ cd doc
$ python3 -m sphinx -b html ./ _build/html/

Continuous integration

The Continuous integration (CI) settings is contained in .gitlab-ci.yml. This runs all the above-mentioned tests, style checks and sphinx page generation on each branch.

Documentation from development branch

The most recent documentation generated from the development branch can be accessed here.