Contributing
Contributions to philote-examples are welcome. This guide explains how to set up a development environment and submit changes.
Getting Started
1. Fork and clone
Fork the repository on GitHub, then clone your fork:
git clone https://github.com/<your-username>/philote-examples.git
cd philote-examples
2. Install in development mode
pip install -e ".[dev]"
This installs the package in editable mode along with development dependencies: pytest, ruff, and pre-commit.
3. Set up pre-commit hooks
pre-commit install
This configures automatic linting and formatting checks before each commit.
Development Workflow
Code style
This project uses Ruff for both linting and formatting:
# Check for lint errors
ruff check src/ tests/ examples/
# Auto-format code
ruff format src/ tests/ examples/
The project enforces:
- Line length of 88 characters
- PEP 8 naming conventions
- Import sorting (isort-compatible)
- Python 3.8+ syntax
Running tests
# Run all tests (excluding XFOIL tests)
pytest
# Run XFOIL tests (requires XFOIL_PATH to be set)
pytest -m xfoil
# Run gradient validation tests
pytest tests/test_naca_gradients.py
Adding a new discipline
If you are adding a new example discipline:
- Create a new module under
src/philote_examples/. - Add an example script under
examples/. - Add tests under
tests/. - Update the documentation under
docs/docs/. - Export the discipline class from
src/philote_examples/__init__.py.
Submitting Changes
- Create a feature branch from
main. - Make your changes and ensure all tests pass.
- Run
ruff checkandruff formatto ensure code style compliance. - Commit with a clear, descriptive message.
- Push to your fork and open a pull request against
main.
Reporting Issues
Please use the GitHub Issues page to report bugs or request features.