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 python/tests/.
# Run full test suite
pytest python/tests/ -v
# Run specific test file
pytest python/tests/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 novaphy/include novaphy/src python/bindings -name "*.h" -o -name "*.cpp" | xargs clang-format --dry-run --Werror
# Auto-fix
find novaphy/include novaphy/src python/bindings -name "*.h" -o -name "*.cpp" | xargs clang-format -i
# Python linting
ruff check python/ python/tests/ python/demos/ --select=E,W,F,I
Documentation¶
Documentation is built with MkDocs Material
and deployed to Cloudflare Pages by the Docs (Cloudflare Pages) GitHub Actions workflow.
# Install docs dependencies
pip install mkdocs-material pymdown-extensions mkdocs-autorefs
# Serve locally
mkdocs serve
# Build
mkdocs build
Documentation changes under docs/**, mkdocs.yml, or the documentation
workflow are built by CI before deployment.
Pull Request Process¶
- Create a feature branch from
main - Make your changes with tests
- Ensure all tests pass:
pytest python/tests/ -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.