Installation¶
Install natto from source, with the extras for tests and documentation:
git clone https://github.com/wengroup/natto.git
cd natto
pip install -e ".[test,doc]"Run the tests with pytest.
Build the docs¶
The documentation is built with Jupyter Book 2. Its pages
are notebooks, so pass --execute to run their code and show the results. From the
docs directory, start a live preview with
jupyter-book start --executeor build the static site into docs/_build/html with
jupyter-book build --html --executeA push to main builds the documentation and deploys it to GitHub Pages, at
https://
Code style¶
Python code is linted and formatted with Ruff, and YAML files with prettier.
Docstrings follow the Google style.
The documentation is written in MyST Markdown.
pre-commit runs all the checks, and fixes what it can:
pip install pre-commit
pre-commit run --all-files --show-diff-on-failureTo run them on every commit, install them as a git hook with pre-commit install, and
remove it with pre-commit uninstall. GitHub Actions runs the same checks, and the
tests, on every push and pull request.