Framework for developing synthetic distribution feeder model.
Project description
NREL-shift
Python package for developing power distribution models using open-source data. This package uses Grid Data Models to represent power distribution components and Ditto for writing case files specific to simulators such as OpenDSS, Cyme, Synergi and others.
Primarily this package leverages OpenStreetMap parcels and road networks to build synthetic distribution feeder models.
Features
- Automated Feeder Generation: Build distribution feeder models from OpenStreetMap data
- Graph-Based Network Modeling: Use NetworkX graphs for flexible network representation
- Equipment Mapping: Map transformers, loads, and other equipment to network nodes and edges
- Phase Balancing: Automatically balance phases across distribution transformers
- Voltage Mapping: Assign appropriate voltage levels throughout the distribution network
- Visualization Tools: Built-in plotting capabilities using Plotly
- Simulator Export: Export models to various power system simulators via Grid Data Models
- MCP Server: Model Context Protocol server for AI assistant integration
Installation
From PyPI (when available)
pip install nrel-shift
From Source
git clone https://github.com/NREL-Distribution-Suites/shift.git
cd shift
pip install -e .
Development Installation
For development with testing and documentation tools:
pip install -e ".[dev,doc]"
MCP Server Installation
For MCP (Model Context Protocol) server support:
pip install -e ".[mcp]"
See MCP Server Documentation for details on using NREL-shift with AI assistants like Claude.
Quick Start
Fetch Parcels from OpenStreetMap
from shift import parcels_from_location, GeoLocation
from gdm.quantities import Distance
# Fetch parcels by address
parcels = parcels_from_location("Fort Worth, TX", Distance(500, "m"))
# Or by coordinates
location = GeoLocation(longitude=-97.3, latitude=32.75)
parcels = parcels_from_location(location, Distance(500, "m"))
Build a Road Network Graph
from shift import get_road_network
# Get road network from address
graph = get_road_network("Fort Worth, TX", Distance(500, "m"))
Create a Distribution System
from shift import (
DistributionSystemBuilder,
DistributionGraph,
BalancedPhaseMapper,
TransformerVoltageMapper,
EdgeEquipmentMapper
)
# Initialize components
dist_graph = DistributionGraph()
# ... add nodes and edges to graph
phase_mapper = BalancedPhaseMapper(dist_graph)
voltage_mapper = TransformerVoltageMapper(dist_graph)
equipment_mapper = EdgeEquipmentMapper(dist_graph)
# Build the system
system = DistributionSystemBuilder(
name="my_feeder",
dist_graph=dist_graph,
phase_mapper=phase_mapper,
voltage_mapper=voltage_mapper,
equipment_mapper=equipment_mapper
)
Documentation
For detailed usage and API documentation, see the docs directory:
User Guides
- Complete Example - End-to-end workflow
- Building a Graph
- Building a Distribution System
- Fetching Parcels
- Mapping Equipment
- Mapping Phases
- Mapping Voltages
Developer Resources
- API Quick Reference - Quick lookup for all APIs
- MCP Server Guide - AI assistant integration
- Contributing Guidelines - How to contribute
- Quick Start for Developers - Fast-track setup
Running Tests
# Install development dependencies
pip install -e ".[dev]"
# Run all tests
pytest
# Run with coverage
pytest --cov=shift --cov-report=html
# Run specific test file
pytest tests/test_graph.py
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Development Setup
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/shift.git - Install development dependencies:
pip install -e ".[dev,doc]" - Create a feature branch:
git checkout -b feature-name - Make your changes and add tests
- Run tests:
pytest - Run linter:
ruff check . - Commit and push your changes
- Create a pull request
Requirements
- Python >= 3.10
- OSMnx (for OpenStreetMap data)
- NetworkX (for graph operations)
- Grid Data Models (for power system components)
- See pyproject.toml for complete dependencies
License
This project is licensed under the BSD-3-Clause License - see the LICENSE.txt file for details.
Authors
- Kapil Duwadi (Kapil.Duwadi@nrel.gov)
- Aadil Latif (Aadil.Latif@nrel.gov)
- Erik Pohl (Erik.Pohl@nrel.gov)
Citation
If you use this package in your research, please cite:
@software{nrel_shift,
title = {NREL-shift: Framework for Developing Synthetic Distribution Feeder Models},
author = {Duwadi, Kapil and Latif, Aadil and Pohl, Erik},
year = {2026},
url = {https://github.com/NREL-Distribution-Suites/shift}
}
Support
For questions and support:
- Open an issue
- Check the documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nrel_shift-0.6.1.tar.gz.
File metadata
- Download URL: nrel_shift-0.6.1.tar.gz
- Upload date:
- Size: 1.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b0fa540caff000998c5ddcd3a6ad5f9ba1d98cf8f5ae02771040fa6a1f1613d
|
|
| MD5 |
180cffbef8b1d1f409ff3ffef47092ee
|
|
| BLAKE2b-256 |
838d477196cd91b79df7cc21fff59182f7bbc57be8866cbbe0ff4893f2eddcc9
|
Provenance
The following attestation bundles were made for nrel_shift-0.6.1.tar.gz:
Publisher:
publish_to_pypi.yaml on NREL-Distribution-Suites/shift
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nrel_shift-0.6.1.tar.gz -
Subject digest:
6b0fa540caff000998c5ddcd3a6ad5f9ba1d98cf8f5ae02771040fa6a1f1613d - Sigstore transparency entry: 870847973
- Sigstore integration time:
-
Permalink:
NREL-Distribution-Suites/shift@39398fbc4509bce587bcfa4d14928306e02153fb -
Branch / Tag:
refs/tags/v0.6.1 - Owner: https://github.com/NREL-Distribution-Suites
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_to_pypi.yaml@39398fbc4509bce587bcfa4d14928306e02153fb -
Trigger Event:
release
-
Statement type:
File details
Details for the file nrel_shift-0.6.1-py3-none-any.whl.
File metadata
- Download URL: nrel_shift-0.6.1-py3-none-any.whl
- Upload date:
- Size: 45.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
147e7460a6c329d0c422ca3908a85f321058a0a3a6b14156b8daf550479b89d2
|
|
| MD5 |
e635a61701d9a7f321658c6e9de752cd
|
|
| BLAKE2b-256 |
ba017ceaa02f125aba3ecc94ba3f33df116ca17c8260ac3779f9b575721c5913
|
Provenance
The following attestation bundles were made for nrel_shift-0.6.1-py3-none-any.whl:
Publisher:
publish_to_pypi.yaml on NREL-Distribution-Suites/shift
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nrel_shift-0.6.1-py3-none-any.whl -
Subject digest:
147e7460a6c329d0c422ca3908a85f321058a0a3a6b14156b8daf550479b89d2 - Sigstore transparency entry: 870847975
- Sigstore integration time:
-
Permalink:
NREL-Distribution-Suites/shift@39398fbc4509bce587bcfa4d14928306e02153fb -
Branch / Tag:
refs/tags/v0.6.1 - Owner: https://github.com/NREL-Distribution-Suites
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_to_pypi.yaml@39398fbc4509bce587bcfa4d14928306e02153fb -
Trigger Event:
release
-
Statement type: