Contributing
We welcome contributions to PropFlow! This guide will help you get started.
Getting Started
Fork the repository on GitHub
Clone your fork locally:
git clone https://github.com/YOUR-USERNAME/Belief-Propagation-Simulator.git
cd Belief-Propagation-Simulator
Create a virtual environment and install development dependencies:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -e ".[dev]"
Create a new branch for your feature:
git checkout -b feature/your-feature-name
Development Workflow
Running Tests
Run the full test suite:
pytest
Run with coverage:
pytest --cov=src --cov-report=html
Code Quality
Format code with Black:
black src/ tests/
Lint with Flake8:
flake8 src/ tests/
Type check with MyPy:
mypy src/
Or run all checks with pre-commit:
pre-commit run --all-files
Documentation
Build documentation locally:
cd docs
make html
open _build/html/index.html # On Mac
# Or: start _build/html/index.html # On Windows
Contribution Guidelines
Code Style
Follow PEP 8
Use Black for formatting (line length 120)
Add type hints to all functions
Write descriptive docstrings in Google/NumPy format
Commit Messages
Use conventional commit format:
feat: Add new feature
fix: Fix bug in module
docs: Update documentation
test: Add tests
refactor: Refactor code
chore: Update dependencies
Pull Requests
Ensure all tests pass
Add tests for new features
Update documentation as needed
Keep PRs focused on a single change
Write a clear PR description
Testing
Write unit tests for new code
Maintain test coverage above 90%
Use pytest fixtures for common setups
Test edge cases and error handling
What to Contribute
Ideas for contributions:
🐛 Bug fixes: Fix reported issues
✨ New features: Add new algorithms or policies
📚 Documentation: Improve docs and examples
🧪 Tests: Increase test coverage
🎨 Visualization: Add plotting capabilities
🚀 Performance: Optimize algorithms
🔧 Tools: Add utilities and helpers
Need Ideas?
Check out:
Issues labeled “good first issue”
Issues labeled “help wanted”
Questions?
Open a GitHub Issue for bugs or feature requests
Start a GitHub Discussion for questions
Contact the maintainers
License
By contributing, you agree that your contributions will be licensed under the MIT License.