Contributing¶
Thank you for your interest in contributing to NovaPhy!
Development Setup¶
-
Clone the repository:
-
Create the conda environment:
-
Install in development mode:
Code Conventions¶
C++¶
- C++20 standard
- float32 only — never use
double; use Eigen*ftypes #pragma oncefor include guards- Namespace:
novaphy - Classes:
PascalCase, functions:snake_case, private members:trailing_underscore_ - Spatial algebra:
[angular; linear](Featherstone convention)
Python¶
- PEP 8 style
- Type hints where practical
Testing¶
Every new Python-exposed feature must have a corresponding test in tests/python/.
# Run full test suite
pytest tests/python/ -v
# Run specific test file
pytest tests/python/test_collision.py -v
Writing Tests¶
- Use analytical comparisons for physics validation
- Float32 tolerance:
pytest.approx(expected, rel=1e-4) - Keep tests independent — no shared mutable state
- Name files
test_<module>.py, functionstest_<behavior>
Code Quality¶
Formatting¶
# Check C++ formatting
find include/novaphy src python/bindings -name "*.h" -o -name "*.cpp" | xargs clang-format --dry-run --Werror
# Auto-fix
find include/novaphy src python/bindings -name "*.h" -o -name "*.cpp" | xargs clang-format -i
# Python linting
ruff check python/ tests/ demos/ --select=E,W,F,I
Documentation¶
Documentation is built with MkDocs Material and deployed to GitHub Pages.
# Install docs dependencies
pip install mkdocs-material pymdown-extensions mkdocs-autorefs
# Serve locally
mkdocs serve
# Build
mkdocs build
Pull Request Process¶
- Create a feature branch from
main - Make your changes with tests
- Ensure all tests pass:
pytest tests/python/ -v - Push and create a PR against
main - CI will run on Ubuntu and Windows
License¶
By contributing, you agree that your contributions will be licensed under the MIT License.