Thank you for your interest in contributing to the CIM Grid Control Engine! This project aims to advance distribution grid analysis through physics-based modeling and intelligent control systems. We welcome contributions from the power systems community, software developers, and researchers.
- Code of Conduct
- Getting Started
- How Can I Contribute?
- Development Guidelines
- Coding Standards
- Testing Requirements
- Pull Request Process
- Community and Support
This project adheres to a code of conduct that promotes a welcoming and inclusive environment. By participating, you are expected to uphold this standard. Please be respectful, collaborative, and constructive in all interactions.
- Python 3.8 or higher
- Understanding of power systems fundamentals
- Familiarity with PandaPower library (optional but helpful)
- Knowledge of IEC 61970 CIM standards (for data model contributions)
-
Fork the repository
# Fork via GitHub UI, then clone your fork git clone https://github.com/YOUR_USERNAME/cim-grid-control-engine.git cd cim-grid-control-engine
-
Create a virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Run the test suite
python main.py
Before creating bug reports, please check existing issues to avoid duplicates. When you create a bug report, include:
- Clear descriptive title
- Detailed description of the issue
- Steps to reproduce the behavior
- Expected vs. actual behavior
- System information (OS, Python version, dependency versions)
- Error messages or stack traces
- Sample grid data if applicable (anonymized if necessary)
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, include:
- Use case description - What problem does this solve?
- Proposed solution - How should it work?
- Alternatives considered - What other approaches did you consider?
- Impact on existing features - Will this break anything?
- Relevant research or standards - Links to papers, standards, or documentation
-
Load Flow Algorithms
- Additional solver implementations (Newton-Raphson, Gauss-Seidel)
- Performance optimizations for large networks
- Convergence improvements
-
Control Strategies
- Alternative Volt-VAR control algorithms
- Coordination strategies for distributed energy resources (DER)
- Advanced hosting capacity methodologies
-
CIM Compliance
- Enhanced IEC 61970 support
- Data model validation
- Import/export utilities for standard formats
-
Documentation
- Code documentation and docstrings
- Usage examples and tutorials
- Validation case studies
- API reference improvements
-
Testing
- Additional test cases
- Real-world grid validation scenarios
- Performance benchmarks
Use descriptive branch names that reflect the purpose:
feature/description- New features (e.g.,feature/newton-raphson-solver)fix/description- Bug fixes (e.g.,fix/voltage-convergence-issue)docs/description- Documentation updatesrefactor/description- Code refactoringtest/description- Test additions
Write clear, concise commit messages:
Add forward-backward sweep solver optimization
- Implement sparse matrix operations for improved performance
- Add convergence tolerance parameter
- Update documentation with performance benchmarks
Addresses #42
Format:
- Use imperative mood ("Add feature" not "Added feature")
- First line: Brief summary (50 characters or less)
- Blank line
- Detailed description (wrap at 72 characters)
- Reference related issues
We follow PEP 8 with some project-specific conventions:
- Line length: Maximum 100 characters
- Indentation: 4 spaces (no tabs)
- Naming conventions:
- Classes:
PascalCase - Functions/variables:
snake_case - Constants:
UPPER_SNAKE_CASE - Private methods:
_leading_underscore
- Classes:
All public functions and classes must include docstrings:
def calculate_voltage_profile(network, load_data):
"""
Calculate voltage profile for all buses in the distribution network.
Args:
network (dict): Network topology and parameters following CIM structure
load_data (pd.DataFrame): Load profile data with columns ['bus_id', 'p_mw', 'q_mvar']
Returns:
pd.DataFrame: Voltage magnitude and angle for each bus
Raises:
ConvergenceError: If power flow does not converge within max iterations
ValueError: If network topology is invalid
Example:
>>> network = load_cim_network('grid_model.xml')
>>> loads = pd.read_csv('load_profile.csv')
>>> voltages = calculate_voltage_profile(network, loads)
"""
pass- Keep functions focused and single-purpose
- Avoid deep nesting (max 3 levels)
- Use meaningful variable names
- Add comments for complex algorithms or non-obvious logic
- Group related functions into modules
All contributions must include appropriate tests:
# Run all tests
python main.py
# Run specific validation scenarios
python -c "from main import run_validation; run_validation()"- New features: Minimum 80% code coverage
- Bug fixes: Include test case that reproduces the bug
- Algorithm changes: Include validation against known results
def test_forward_backward_sweep_ieee13():
"""
Test FBS solver accuracy against IEEE 13-bus test feeder.
Validates:
- Voltage profile matches reference within tolerance
- Power flow convergence
- Loss calculations
"""
# Arrange
network = load_ieee_test_feeder(13)
expected_voltages = load_reference_results('ieee13_voltages.csv')
# Act
results = forward_backward_sweep(network)
# Assert
assert_voltage_within_tolerance(results, expected_voltages, tolerance=1e-4)
assert results['converged'] == True
assert results['iterations'] < 10-
Update your branch
git checkout main git pull upstream main git checkout your-feature-branch git rebase main
-
Run all tests and ensure they pass
-
Update documentation to reflect any changes
-
Review your changes - check for debug code, commented sections, or unnecessary files
- Push your branch to your fork
- Navigate to the original repository
- Click "New Pull Request"
- Select your branch
- Fill out the PR template with:
- Description: What does this PR do?
- Motivation: Why is this change needed?
- Testing: How was this tested?
- Breaking changes: Any backwards incompatibility?
- Related issues: Link to relevant issues
- Maintainers will review your code
- Address feedback by pushing new commits
- Once approved, your PR will be merged
- You may be asked to squash commits before merging
- Code follows project style guidelines
- Self-review completed
- Comments added for complex logic
- Documentation updated
- Tests added and passing
- No merge conflicts
- Commit messages are clear
- GitHub Issues: Bug reports and feature requests
- GitHub Discussions: Questions, ideas, and general discussion
- Pull Requests: Code contributions and reviews
If you need help:
- Check existing documentation and issues
- Search for similar questions in discussions
- Create a new discussion with:
- Clear description of what you're trying to do
- What you've already tried
- Relevant code snippets or error messages
Contributors are recognized in:
- Release notes for significant contributions
- README acknowledgments
- Git commit history
- IEC 61970 (CIM)
- IEEE Test Feeders
- VDE-AR-N 4105 - Voltage regulation standards
- PandaPower Documentation: https://pandapower.readthedocs.io/
- Distribution System Analysis: Kersting, W.H. "Distribution System Modeling and Analysis"
- Grid Integration: EPRI Distribution System Analysis Guidelines
- Linting:
flake8orpylint - Formatting:
black(optional) - Type checking:
mypy(optional)
Thank you for contributing to advancing open-source power systems analysis tools!
For questions about contributing, open a discussion or reach out through GitHub issues.