Developer Guide¶
Welcome to the GHGPy developer guide! This page will help you contribute to the project.
Development Setup¶
1. Clone the Repository¶
2. Create Virtual Environment¶
3. Install Development Dependencies¶
Project Structure¶
ghgpy/
├── src/ghgpy/ # Main package source
│ ├── __init__.py # Package init with version
│ ├── activities/ # IPCC sector calculations
│ │ └── energy.py # Combustion classes
│ ├── datamodel/ # Data classes
│ │ ├── db.py # Database handlers
│ │ ├── fuel.py # Fuel models
│ │ ├── ghg.py # GHG gas classes
│ │ └── unumber.py # Uncertainty numbers
│ ├── data/ # Default data
│ └── factory.py # Factory class
├── tests/ # Test suite
├── docs/ # Documentation (MkDocs)
├── examples/ # Example scripts
├── pyproject.toml # Package configuration
└── mkdocs.yml # Docs configuration
Running Tests¶
# Run all tests
pytest tests/ -v
# Run with coverage
pytest tests/ --cov=src/ghgpy --cov-report=html
Code Style¶
We use the following tools:
- Black - Code formatting
- Flake8 - Linting
- MyPy - Type checking
Building Documentation¶
Contributing Guidelines¶
1. Fork the Repository¶
Fork on GitHub and clone your fork locally.
2. Create a Branch¶
3. Make Changes¶
- Follow the code style guidelines
- Add tests for new features
- Update documentation
4. Run Tests¶
5. Commit Changes¶
6. Push and Create PR¶
Then create a Pull Request on GitHub.
Adding Emission Factors¶
See our workflow guide: Add Emission Factor
Implementing New Methodologies¶
See our workflow guide: Implement Methodology
Questions?¶
- Open an Issue
- Email: bkt992@gmail.com
Code of Conduct¶
Please be respectful and constructive in all interactions.