Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Developer Guide

Quick start

Thanks for contributing! 🙏 Below you can find an overview of the commands to get you up and running quickly.

First clone the repository from GitHub

git clone <GITHUB-REPO>

and install the package locally in editable mode (-e):

cd aiida-epw
pip install -e .
Default
uv
Hatch

The “default” approach to developing is to install the development extras in your current environment:

pip install -e .[pre-commit,tests,docs]

🔧 Pre-commit

To make sure your changes adhere to our formatting/linting preferences, install the pre-commit hooks:

pre-commit install

They will then run on every git commit. You can also run them on e.g. all files using:

pre-commit run -a

Drop the -a option in case you only want to run on staged files.

🧪 Tests

You can run all tests in the tests directory with pytest:

pytest

Or select the test module:

pytest tests/parsers/test_pw.py

See the pytest documentation for more information.

📚 Documentation

We use MyST as our documentation framework. Go into the docs directory and start the documentation server with:

myst start

and open the documentation in your browser via the link shown. Every time you save a file, the corresponding documentation page is updated automatically!

A GitHub action is set up to automatically deploy the documentation to GitHub Pages. See the corresponding GitHub Pages documentation for the steps required.

Pre-commit rules

From the extensive Ruff ruleset, we ignore the following globally:

CodeRuleRationale / Note
TRY003raise-vanilla-argsFormatting warning/exception messages beforehand makes the code less readable, for a minor benefit in readability of the exception.
EM101raw-string-in-exceptionSame as TRY003
EM102f-string-in-exceptionSame as TRY003
PLR2004magic-value-comparisonWe have a lot of “magic values” to compare with in scientific code; naming them all would reduce readability for little benefit.
FBT002boolean-default-value-positional-argumentWe understand the concept, but adhering to this rule is not a small change in syntax; disable for now.
TID252relative-importsWe don’t mind relative imports; as long as you don’t go up a level, they’re more readable (less verbose).

And the following rules for the files in the tests directory:

CodeRuleRationale / Note
INP001implicit-namespace-packageWhen tests are not part of the package, there is no need for __init__.py files.
S101assertAsserts should not be used in production environments, but are fine for tests.