Developer Guide¶
Contributions are welcome! Please feel free to submit a Pull Request.
Setting Up for Development¶
git clone https://github.com/Yi5817/Genarris.git
cd Genarris
git submodule update --init --recursive
pip install -e .[test]
Code Style¶
Genarris uses ruff for linting and formatting, run through pre-commit. Install the hooks once:
pip install --group dev
pre-commit install
The hooks then run on every commit. CI runs pre-commit run --all-files.
Running the Tests¶
pytest # installation and unit tests, a few seconds
pytest -m integration # full workflows under mpirun, a few minutes
The tests live in tests/, grouped by what they check:
install/– the package, its compiledcgenarrisextension, packaged data files, task registry and thegnrscommand are usable with only the core dependencies installed.restart/– checkpoint logs and the restart manager, in a single process.workflow/– a tiny benzene workflow undermpirunexercising restart, checkpoint recovery and--overwriteend to end. Needsmpirunon thePATHand is skipped otherwise.
Run one group with pytest tests/install.
Both sets run in CI on every push and pull request.
Adding a New Energy Calculator¶
Create a new module under
gnrs/energy/.Implement a class that inherits from
EnergyCalculatorABC.Register the new calculator in
gnrs/core/registry.py.
See the gnrs.energy page for the base class interface.
Adding a New Optimizer¶
Create a new module under
gnrs/optimize/.Implement a class that inherits from
GeometryOptimizerABC.Register the new optimizer in
gnrs/core/registry.py.