Metadata-Version: 2.4
Name: NREL-erad
Version: 0.1.14
Summary: Graph based scalable tool for computing energy resilience metrics for distribution systems.
Author-email: Aadil Latif <aadil.latif@nlr.gov>, Kapil Duwadi <kapil.duwadi@nlr.gov>, Kwami Sedzro <kwami.sedzro@nlr.gov>, Sherin Ann Abraham <sherinann.abraham@nlr.gov>, Bryan Palmintier <bryan.palmintier@nlr.gov>
Maintainer-email: Aadil Latif <aadil.latif@nlr.gov>
Project-URL: Homepage, https://github.com/NLR-Distribution-Suite/erad
Keywords: Distribution,Earthquake,Energy,Fire,Flooding,Power,Python,Resilience,Systems
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: grid-data-models==2.3.7
Requires-Dist: gdmloader
Requires-Dist: geopandas
Requires-Dist: requests
Requires-Dist: elevation
Requires-Dist: shapely
Requires-Dist: pandas
Requires-Dist: pyhigh
Requires-Dist: geopy
Requires-Dist: scipy
Requires-Dist: sqlmodel
Requires-Dist: loguru>=0.7.0
Requires-Dist: mcp>=1.0.0
Requires-Dist: typer>=0.9.0
Requires-Dist: rich>=13.0.0
Requires-Dist: duckdb>=1.0
Requires-Dist: pyarrow
Provides-Extra: dev
Requires-Dist: black; extra == "dev"
Requires-Dist: mkdocs; extra == "dev"
Requires-Dist: mkdocs-jupyter; extra == "dev"
Requires-Dist: mkdocs-material; extra == "dev"
Requires-Dist: mkdocstrings[python]; extra == "dev"
Requires-Dist: pylint; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-asyncio; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Provides-Extra: doc
Requires-Dist: sphinx; extra == "doc"
Requires-Dist: pydata-sphinx-theme; extra == "doc"
Requires-Dist: myst-parser; extra == "doc"
Requires-Dist: autodoc_pydantic; extra == "doc"
Requires-Dist: sphinxcontrib-mermaid; extra == "doc"
Requires-Dist: jupyter-book==2.1.6; extra == "doc"
Dynamic: license-file



[![CodeFactor](https://www.codefactor.io/repository/github/nlr-distribution-suite/erad/badge)](https://www.codefactor.io/repository/github/nlr-distribution-suite/erad) • [![codecov](https://codecov.io/gh/NLR-Distribution-Suite/erad/graph/badge.svg?token=FtAWhS5svb)](https://codecov.io/gh/NLR-Distribution-Suite/erad) • [![GitHub license](https://img.shields.io/github/license/NLR-Distribution-Suite/erad)](https://github.com/NLR-Distribution-Suite/erad/blob/main/LICENSE.txt) • [![GitHub issues](https://img.shields.io/github/issues/NLR-Distribution-Suite/erad)](https://github.com/NLR-Distribution-Suite/erad/issues) • ![PyPI - Downloads](https://img.shields.io/pypi/dm/NREL-erad) • [![Upload to PyPi](https://github.com/NLR-Distribution-Suite/erad/actions/workflows/publish.yml/badge.svg)](https://github.com/NLR-Distribution-Suite/erad/actions/workflows/publish.yml) • [![deploy-book](https://github.com/NLR-Distribution-Suite/erad/actions/workflows/deploy.yml/badge.svg)](https://github.com/NLR-Distribution-Suite/erad/actions/workflows/deploy.yml) • [![Pytest](https://github.com/NLR-Distribution-Suite/erad/actions/workflows/pull_request_tests.yml/badge.svg)](https://github.com/NLR-Distribution-Suite/erad/actions/workflows/pull_request_tests.yml) • [![DOI](https://joss.theoj.org/papers/10.21105/joss.08782/status.svg)](https://doi.org/10.21105/joss.08782) • ![MCP Server](https://img.shields.io/badge/MCP_Server-enabled-brightgreen) • ![MCP Tools](https://img.shields.io/badge/MCP_Tools-26-blue)

<p align="center"> 
<img src="docs/_static/light.png" width="400" style="display:flex;justify-content:center;">
</p>

# ERAD (<u>E</u>nergy <u>R</u>esilience <u>A</u>nalysis for electric <u>D</u>istribution systems)

[Visit full documentation here.](https://nlr-distribution-suite.github.io/erad/)

Understanding the impact of disaster events on people's ability to access critical services is key to designing appropriate programs to minimize the overall impact. Flooded roads, downed power lines, flooded power substation etc. could impact access to critical services like electricity, food, health and more. The field of disaster modeling is still evolving and so is our understanding of how these events would impact our critical infrastructures such power grid, hospitals, groceries, banks etc.

ERAD is a free, open-source Python toolkit for computing energy resilience measures in the face of hazards like earthquakes and flooding. It uses graph database to store data and perform computation at the household level for a variety of critical services that are connected by power distribution network. It uses asset fragility curves, which are functions that relate hazard severity to survival probability for power system assets including cables, transformers, substations, roof-mounted solar panels, etc. recommended in top literature. Programs like undergrounding, microgrid, and electricity backup units for critical infrastructures may all be evaluated using metrics and compared across different neighborhoods to assess their effects on energy resilience.

ERAD is designed to be used by researchers, students, community stakeholders, distribution utilities to understand and possibly evaluate effectiveness of different post disaster programs to improve energy resilience. It was funded by National Laboratory of the Rockies (NLR) and made publicly available with open license.

```mermaid
flowchart TD
A([Start])
B[Select entry point<br/>CLI or Python API or MCP tools]
C[Load Asset System<br/>Distribution model from file or cache]
D{Hazard input available?}
E[Load Hazard Model<br/>from JSON or model reference]
F[Create Empty Hazard System]
G[Add Historic Hazard Events<br/>Earthquake, Hurricane, Wildfire]
H[Validate fragility curve set<br/>DEFAULT_CURVES or custom]
I[Run Simulation<br/>asset system id plus hazard system id]
J[Simulation Result ID<br/>asset states and probabilities]
K[Analyze Results<br/>query assets, stats, topology]
L{Need uncertainty scenarios?}
M[Generate Monte Carlo Scenarios<br/>num samples and seed]
N[Tracked Changes Output]
O{Need exports?}
P[Export to SQLite<br/>for downstream analytics]
Q[Export to JSON<br/>asset and hazard systems]
R[Export Tracked Changes<br/>scenario deltas]
S[Clear loaded systems<br/>free memory and reset state]
T([End])

A --> B --> C --> D
D -- Yes --> E --> H
D -- No --> F --> G --> H
H --> I --> J --> K --> L
L -- Yes --> M --> N --> O
L -- No --> O
O -- Yes --> P
O -- Yes --> Q
O -- Yes --> R
O -- No --> S
P --> S
Q --> S
R --> S
S --> T

classDef startEnd fill:#0f172a,color:#ffffff,stroke:#0f172a,stroke-width:2px
classDef intake fill:#e0f2fe,color:#0c4a6e,stroke:#0284c7,stroke-width:1.5px
classDef decision fill:#fff7ed,color:#9a3412,stroke:#f97316,stroke-width:2px
classDef output fill:#f5f3ff,color:#4c1d95,stroke:#8b5cf6,stroke-width:1.5px
classDef cleanup fill:#f1f5f9,color:#334155,stroke:#64748b,stroke-width:1.5px

class A,T startEnd
class B,C,E,F,G,H,I,K,M intake
class D,L,O decision
class J,N,P,Q,R output
class S cleanup
```
