How rwl/pypower works
PYPOWER is a Python power-system analysis library. Its principal workflow loads a case, configures a power-flow or optimal-power-flow run, solves it, and returns or reports the resulting operating state. The graph separates case data and indexing, power-flow calculation, OPF formulation and solver execution, and result handling. README documents DC/AC power flow and OPF; source-index references support the main runtime connections shown. Unsampled modules are represented only where the tree or index establishes a subsystem, so some internal solver details are not expanded.
Main entry points: runpf.py Power flow entry · runopf.py OPF entry · opf.py OPF orchestration · loadcase.py Case loader
Components 17
Case data
- Case loader
pypower/loadcase.py - Example cases
pypower/case14.py - Bus fields
pypower/idx_bus.py - Generator fields
pypower/idx_gen.py - Branch fields
pypower/idx_brch.py - Cost fields
pypower/idx_cost.py - Run options
pypower/ppoption.py
Power flow
- Power flow entry
pypower/runpf.py - Internal indexing
pypower/ext2int.py - PF methods
pypower/newtonpf.py
Optimal power flow
- OPF entry
pypower/runopf.py - OPF orchestration
pypower/opf.py - OPF formulation
pypower/opf_setup.py - Solver dispatch
pypower/opf_execute.py
Results
- Power flow report
pypower/printpf.py - Case export
pypower/savecase.py
Other components
- Python user
Connections 17
- Python user → Case loader: supplies case
pypower/loadcase.py - Example cases → Case loader: loads case data
- Python user → Power flow entry: requests power flow
- Python user → OPF entry: requests OPF
- Power flow entry → Case loader: loads case
pypower/runpf.py - Power flow entry → Run options: uses options
pypower/runpf.py - Power flow entry → Internal indexing: converts indexing
pypower/runpf.py - Power flow entry → PF methods: dispatches methods
pypower/runpf.py - Power flow entry → Power flow report: prints results
pypower/runpf.py - Power flow entry → Case export: saves case
pypower/runpf.py - OPF entry → Run options: uses options
pypower/runopf.py - OPF entry → OPF orchestration: runs OPF
pypower/runopf.py - OPF entry → Power flow report: prints results
pypower/runopf.py - OPF entry → Case export: saves case
pypower/runopf.py - OPF orchestration → Internal indexing: converts indexing
pypower/opf.py - OPF orchestration → OPF formulation: sets up model
pypower/opf.py - OPF orchestration → Solver dispatch: executes model
pypower/opf.py