Skip to main content

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

Developer Resources

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

  1. Fork the repository
  2. Clone your fork: git clone https://github.com/YOUR_USERNAME/shift.git
  3. Install development dependencies: pip install -e ".[dev,doc]"
  4. Create a feature branch: git checkout -b feature-name
  5. Make your changes and add tests
  6. Run tests: pytest
  7. Run linter: ruff check .
  8. Commit and push your changes
  9. 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

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:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nrel_shift-0.6.1.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nrel_shift-0.6.1-py3-none-any.whl (45.6 kB view details)

Uploaded Python 3

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

Hashes for nrel_shift-0.6.1.tar.gz
Algorithm Hash digest
SHA256 6b0fa540caff000998c5ddcd3a6ad5f9ba1d98cf8f5ae02771040fa6a1f1613d
MD5 180cffbef8b1d1f409ff3ffef47092ee
BLAKE2b-256 838d477196cd91b79df7cc21fff59182f7bbc57be8866cbbe0ff4893f2eddcc9

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for nrel_shift-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 147e7460a6c329d0c422ca3908a85f321058a0a3a6b14156b8daf550479b89d2
MD5 e635a61701d9a7f321658c6e9de752cd
BLAKE2b-256 ba017ceaa02f125aba3ecc94ba3f33df116ca17c8260ac3779f9b575721c5913

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page