Thank you for your interest in contributing to GridOS! This document provides guidelines and instructions for contributing to the project.
By participating in this project, you agree to abide by our Code of Conduct.
- Use GitHub Issues to report bugs or request features
- Search existing issues before creating a new one
- Include steps to reproduce, expected behaviour, and actual behaviour for bugs
- Include your environment details (OS, Python version, GridOS version)
- Fork the repository
- Create a branch from
develop:git checkout -b feature/your-feature-name develop
- Make your changes following the coding standards below
- Write tests for new functionality
- Run the test suite:
pytest tests/ -v --cov=gridos
- Run linting:
ruff check src/ tests/ ruff format src/ tests/
- Commit with a clear message:
git commit -m "feat: add support for SunSpec protocol adapter" - Push and create a Pull Request against
develop
We follow Conventional Commits:
| Prefix | Description |
|---|---|
feat: |
New feature |
fix: |
Bug fix |
docs: |
Documentation changes |
test: |
Adding or updating tests |
refactor: |
Code refactoring |
perf: |
Performance improvement |
ci: |
CI/CD changes |
chore: |
Maintenance tasks |
- Python 3.10+ with type hints on all public functions
- Pydantic v2 for data models
- async/await for all I/O operations
- Ruff for linting and formatting
- pytest for testing with >80% coverage target
- Docstrings in NumPy style for all public classes and functions
- Logging via
logging.getLogger(__name__)— noprint()statements
- Create
src/gridos/adapters/your_protocol.py - Inherit from
BaseAdapter - Implement
connect(),disconnect(),read_telemetry(),write_command() - Add tests in
tests/test_adapters.py - Update
src/gridos/adapters/__init__.py - Document in
docs/architecture.md
- Create
src/gridos/digital_twin/models/your_component.py - Implement
update(dt, grid_state)method - Register in
GridModelclass - Add tests in
tests/test_digital_twin.py
# Clone your fork
git clone https://github.com/your-username/GridOS.git
cd GridOS
# Create virtual environment
python -m venv .venv
source .venv/bin/activate
# Install in development mode
pip install -e ".[dev]"
# Run tests
pytest tests/ -v
# Run linting
ruff check src/ tests/Open a Discussion or reach out to the maintainers.