# e2niee/pandapower architecture

> Architecture diagram of the GitHub repository e2niee/pandapower, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/e2niee/pandapower
- Repository: https://github.com/e2niee/pandapower

## Overview

pandapower is a Python power-system modeling, analysis, and optimization library. A user creates or imports a tabular network model, validates and modifies it, then runs power flow or another analysis; calculation modules write structured results that can be inspected, plotted, or exported. Major documented capabilities include multiple steady-state solvers, optimal power flow, time series, state estimation, short-circuit analysis, topology, protection, grid equivalents, controls, and broad case-format conversion. The graph emphasizes the main runtime route; several subsystems are represented from the tree without claiming unsampled internal calls.

Main entry points: [`pandapower/results.py`](https://github.com/e2niee/pandapower/blob/develop/pandapower/results.py) (Result Tables), [`pandapower/auxiliary.py`](https://github.com/e2niee/pandapower/blob/develop/pandapower/auxiliary.py) (Network Model), [`pandapower/powerflow.py`](https://github.com/e2niee/pandapower/blob/develop/pandapower/powerflow.py) (Power Flow), [`pandapower/optimal_powerflow.py`](https://github.com/e2niee/pandapower/blob/develop/pandapower/optimal_powerflow.py) (Optimal Power Flow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_modeling["Network Modeling"]
  node_api["Public API<br/>[__init__.py]"]
  node_network["Network Model<br/>[auxiliary.py]"]
  node_create["Element Creation<br/>[__init__.py]"]
  node_schema["Schema Validation"]
  node_toolbox["Grid Modification"]
end

subgraph group_analysis["Grid Analysis"]
  node_powerflow["Power Flow<br/>[powerflow.py]"]
  node_pfsolvers["PF Solvers<br/>[__init__.py]"]
  node_topology["Topology Analysis<br/>[graph_searches.py]"]
  node_shortcircuit["Short Circuit<br/>[calc_sc.py]"]
  node_estimation["State Estimation"]
end

subgraph group_optimization["Optimization Control"]
  node_opf["Optimal Power Flow"]
  node_controllers["Controllers<br/>[run_control.py]"]
  node_timeseries["Time Series<br/>[run_time_series.py]"]
  node_storageopf["Storage OPF<br/>[pm_storage.py]"]
end

subgraph group_integration["Conversion Integration"]
  node_converters["Case Converters"]
end

subgraph group_inspection["Results Inspection"]
  node_diagnostics["Diagnostics<br/>[diagnostic.py]"]
  node_results["Result Tables<br/>[results.py]"]
  node_plotting["Plotting<br/>[__init__.py]"]
  node_protection["Protection Analysis<br/>[run_protection.py]"]
  node_equivalents["Grid Equivalents<br/>[get_equivalent.py]"]
end

node_user(("Engineer"))

node_user -->|"uses API"| node_api
node_api -->|"creates elements"| node_create
node_create -->|"writes model"| node_network
node_network -->|"validates data"| node_schema
node_user -.->|"imports cases"| node_converters
node_converters -->|"builds model"| node_network
node_user -->|"modifies grid"| node_toolbox
node_toolbox -->|"updates model"| node_network
node_user -->|"runs analysis"| node_powerflow
node_powerflow -->|"dispatches solver"| node_pfsolvers
node_pfsolvers -->|"writes results"| node_results
node_user -->|"queries topology"| node_topology
node_topology -->|"reads model"| node_network
node_user -->|"runs fault study"| node_shortcircuit
node_shortcircuit -->|"writes results"| node_results
node_user -->|"estimates state"| node_estimation
node_estimation -->|"writes results"| node_results
node_user -->|"optimizes grid"| node_opf
node_opf -.->|"adds storage"| node_storageopf
node_opf -->|"writes results"| node_results
node_user -->|"runs controls"| node_controllers
node_controllers -->|"repeats powerflow"| node_powerflow
node_user -->|"runs scenarios"| node_timeseries
node_timeseries -->|"runs steps"| node_powerflow
node_timeseries -->|"writes time results"| node_results
node_user -->|"checks network"| node_diagnostics
node_diagnostics -->|"tests convergence"| node_powerflow
node_user -->|"runs protection"| node_protection
node_protection -->|"writes results"| node_results
node_user -->|"reduces grid"| node_equivalents
node_equivalents -->|"builds equivalent"| node_network
node_user -->|"plots results"| node_plotting
node_plotting -->|"reads results"| node_results

click node_api "https://github.com/e2niee/pandapower/blob/develop/pandapower/__init__.py"
click node_network "https://github.com/e2niee/pandapower/blob/develop/pandapower/auxiliary.py"
click node_create "https://github.com/e2niee/pandapower/blob/develop/pandapower/create/__init__.py"
click node_schema "https://github.com/e2niee/pandapower/blob/develop/pandapower/network_schema/tools/validation/network_validation.py"
click node_toolbox "https://github.com/e2niee/pandapower/blob/develop/pandapower/toolbox/grid_modification.py"
click node_powerflow "https://github.com/e2niee/pandapower/blob/develop/pandapower/powerflow.py"
click node_pfsolvers "https://github.com/e2niee/pandapower/blob/develop/pandapower/pf/__init__.py"
click node_topology "https://github.com/e2niee/pandapower/blob/develop/pandapower/topology/graph_searches.py"
click node_shortcircuit "https://github.com/e2niee/pandapower/blob/develop/pandapower/shortcircuit/calc_sc.py"
click node_estimation "https://github.com/e2niee/pandapower/blob/develop/pandapower/estimation/state_estimation.py"
click node_opf "https://github.com/e2niee/pandapower/blob/develop/pandapower/optimal_powerflow.py"
click node_controllers "https://github.com/e2niee/pandapower/blob/develop/pandapower/control/run_control.py"
click node_timeseries "https://github.com/e2niee/pandapower/blob/develop/pandapower/timeseries/run_time_series.py"
click node_storageopf "https://github.com/e2niee/pandapower/blob/develop/pandapower/opf/pm_storage.py"
click node_converters "https://github.com/e2niee/pandapower/tree/develop/pandapower/converter"
click node_diagnostics "https://github.com/e2niee/pandapower/blob/develop/pandapower/diagnostic/diagnostic.py"
click node_results "https://github.com/e2niee/pandapower/blob/develop/pandapower/results.py"
click node_plotting "https://github.com/e2niee/pandapower/blob/develop/pandapower/plotting/__init__.py"
click node_protection "https://github.com/e2niee/pandapower/blob/develop/pandapower/protection/run_protection.py"
click node_equivalents "https://github.com/e2niee/pandapower/blob/develop/pandapower/grid_equivalents/get_equivalent.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_api,node_network,node_create,node_schema,node_toolbox toneBlue
class node_powerflow,node_pfsolvers,node_topology,node_shortcircuit,node_estimation toneAmber
class node_opf,node_controllers,node_timeseries,node_storageopf toneMint
class node_converters toneRose
class node_diagnostics,node_results,node_plotting,node_protection,node_equivalents,node_user toneIndigo
```

## Components

### Network Modeling

- [Public API](https://github.com/e2niee/pandapower/blob/develop/pandapower/__init__.py): `pandapower/__init__.py`
- [Network Model](https://github.com/e2niee/pandapower/blob/develop/pandapower/auxiliary.py): `pandapower/auxiliary.py`
- [Element Creation](https://github.com/e2niee/pandapower/blob/develop/pandapower/create/__init__.py): `pandapower/create/__init__.py`
- [Schema Validation](https://github.com/e2niee/pandapower/blob/develop/pandapower/network_schema/tools/validation/network_validation.py): `pandapower/network_schema/tools/validation/network_validation.py`
- [Grid Modification](https://github.com/e2niee/pandapower/blob/develop/pandapower/toolbox/grid_modification.py): `pandapower/toolbox/grid_modification.py`

### Grid Analysis

- [Power Flow](https://github.com/e2niee/pandapower/blob/develop/pandapower/powerflow.py): `pandapower/powerflow.py`
- [PF Solvers](https://github.com/e2niee/pandapower/blob/develop/pandapower/pf/__init__.py): `pandapower/pf/__init__.py`
- [Topology Analysis](https://github.com/e2niee/pandapower/blob/develop/pandapower/topology/graph_searches.py): `pandapower/topology/graph_searches.py`
- [Short Circuit](https://github.com/e2niee/pandapower/blob/develop/pandapower/shortcircuit/calc_sc.py): `pandapower/shortcircuit/calc_sc.py`
- [State Estimation](https://github.com/e2niee/pandapower/blob/develop/pandapower/estimation/state_estimation.py): `pandapower/estimation/state_estimation.py`

### Optimization Control

- [Optimal Power Flow](https://github.com/e2niee/pandapower/blob/develop/pandapower/optimal_powerflow.py): `pandapower/optimal_powerflow.py`
- [Controllers](https://github.com/e2niee/pandapower/blob/develop/pandapower/control/run_control.py): `pandapower/control/run_control.py`
- [Time Series](https://github.com/e2niee/pandapower/blob/develop/pandapower/timeseries/run_time_series.py): `pandapower/timeseries/run_time_series.py`
- [Storage OPF](https://github.com/e2niee/pandapower/blob/develop/pandapower/opf/pm_storage.py): `pandapower/opf/pm_storage.py`

### Conversion Integration

- [Case Converters](https://github.com/e2niee/pandapower/tree/develop/pandapower/converter): `pandapower/converter`

### Results Inspection

- [Diagnostics](https://github.com/e2niee/pandapower/blob/develop/pandapower/diagnostic/diagnostic.py): `pandapower/diagnostic/diagnostic.py`
- [Result Tables](https://github.com/e2niee/pandapower/blob/develop/pandapower/results.py): `pandapower/results.py`
- [Plotting](https://github.com/e2niee/pandapower/blob/develop/pandapower/plotting/__init__.py): `pandapower/plotting/__init__.py`
- [Protection Analysis](https://github.com/e2niee/pandapower/blob/develop/pandapower/protection/run_protection.py): `pandapower/protection/run_protection.py`
- [Grid Equivalents](https://github.com/e2niee/pandapower/blob/develop/pandapower/grid_equivalents/get_equivalent.py): `pandapower/grid_equivalents/get_equivalent.py`

### Other components

- **Engineer**

## Connections

- Engineer → Public API: uses API
- Public API → Element Creation: creates elements
- Element Creation → Network Model: writes model
- Network Model → Schema Validation: validates data
- Engineer → Case Converters: imports cases
- Case Converters → Network Model: builds model
- Engineer → Grid Modification: modifies grid
- Grid Modification → Network Model: updates model
- Engineer → Power Flow: runs analysis
- Power Flow → PF Solvers: dispatches solver
- PF Solvers → Result Tables: writes results
- Engineer → Topology Analysis: queries topology
- Topology Analysis → Network Model: reads model
- Engineer → Short Circuit: runs fault study
- Short Circuit → Result Tables: writes results
- Engineer → State Estimation: estimates state
- State Estimation → Result Tables: writes results
- Engineer → Optimal Power Flow: optimizes grid
- Optimal Power Flow → Storage OPF: adds storage
- Optimal Power Flow → Result Tables: writes results
- Engineer → Controllers: runs controls
- Controllers → Power Flow: repeats powerflow
- Engineer → Time Series: runs scenarios
- Time Series → Power Flow: runs steps
- Time Series → Result Tables: writes time results
- Engineer → Diagnostics: checks network
- Diagnostics → Power Flow: tests convergence
- Engineer → Protection Analysis: runs protection
- Protection Analysis → Result Tables: writes results
- Engineer → Grid Equivalents: reduces grid
- Grid Equivalents → Network Model: builds equivalent
- Engineer → Plotting: plots results
- Plotting → Result Tables: reads results
