Metadata-Version: 2.4
Name: parallel-pandapower-solver
Version: 1.1.0
Summary: CPU / GPU based AC/DC Powerflow solver
Author-email: Mike Vogt <mike.vogt@iee.fraunhofer.de>
Maintainer-email: Mike Vogt <mike.vogt@iee.fraunhofer.de>
Project-URL: bugs, https://github.com/e2niee/p3s/issues
Project-URL: changelog, https://github.com/e2niee/p3s/blob/master/changelog.md
Project-URL: homepage, https://github.com/e2niee/p3s
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
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 :: 3.14
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSES/BSD-3-Clause.txt
Requires-Dist: typer
Requires-Dist: pandapower>3.0.0
Requires-Dist: pybind11
Requires-Dist: scipy
Requires-Dist: numpy
Requires-Dist: intel-cmplr-lib-rt
Requires-Dist: numba
Provides-Extra: docs
Requires-Dist: numpydoc; extra == "docs"
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: sphinx_rtd_theme; extra == "docs"
Requires-Dist: sphinx-pyproject; extra == "docs"
Requires-Dist: sphinxcontrib-imagesvg; extra == "docs"
Provides-Extra: test
Requires-Dist: coverage; extra == "test"
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-timeout; extra == "test"
Requires-Dist: ruff; extra == "test"
Requires-Dist: ty; extra == "test"
Requires-Dist: ipdb; extra == "test"
Requires-Dist: pandas-stubs; extra == "test"
Requires-Dist: mypy; extra == "test"
Provides-Extra: cpp
Requires-Dist: p3s-cpp; extra == "cpp"
Requires-Dist: suitesparse; extra == "cpp"
Provides-Extra: cuda
Requires-Dist: pycuda; extra == "cuda"
Dynamic: license-file

<!--
SPDX-FileCopyrightText: 2026 Fraunhofer IEE

SPDX-License-Identifier: BSD-3-Clause
-->

# p3s - parallel pandapower solver

[![PyPI version](https://img.shields.io/pypi/v/parallel-pandapower-solver.svg)](https://pypi.org/project/parallel-pandapower-solver/)
[![Documentation Status](https://readthedocs.org/projects/parallel-pandapower-solver/badge/?version=latest)](https://parallel-pandapower-solver.readthedocs.io/en/latest/?version=latest)
[![REUSE status](https://api.reuse.software/badge/github.com/e2nIEE/parallel-pandapower-solver)](https://api.reuse.software/info/github.com/e2nIEE/parallel-pandapower-solver)

CPU / GPU based AC/DC Powerflow solver

* PyPI package: https://pypi.org/project/parallel-pandapower-solver/
* Free software: BSD-3-Clause
* Documentation: https://parallel-pandapower-solver.readthedocs.io.

## Features

### Solvers
- C++ Newton-Raphson with KLU, single and multi-threaded (using openMP)
- GPU-resident polar Newton solver (cuDSS, cuSolverRF and cuSolverSp QR)
- reference python / numba implementation

### Study opportunities
- batched timeseries calculation
- N-1 contingency analysis with islanding detection (including a "reslack" feature)
- station controllers solved inside the Newton Raphson (still under review)

### Robustness
- Armijo damped Newton-Raphson
- DC power-flow initialisation with flat start fallback
- voltage-band plausibility check against non-physical roots
- per-case convergence and per-bus served masks

### Integration
- operates directly on pandapower networks (standalone)
- zero-copy numpy interface, using pybind11, no per-call marshalling
- Linux and Windows native builds; pip installable
- Will be directly integrated in pandapower

### Verification
- all results are verified against pandapower
- test pipeline automatically tests every change
- accuracy is 1e-11 vs pandapower

## Installation

Compiled C++/KLU Newton-Raphson solver (the `nr_klu` extension). Opt-in because it needs a C++17 compiler and SuiteSparse/KLU at build time.
Installs the separate `p3s-cpp` distribution, whose CMake build drops `nr_klu` into the p3s package so `from p3s import nr_klu` works.

```bash
pip install p3s[cpp]              # from an index (published p3s-cpp)
pip install .[cpp]                # from a checkout (see note below)
```

From a source checkout, p3s-cpp is not on an index, so build it explicitly:
  pip install ./p3s/cpp
(SuiteSparse must be available, e.g. `conda install -c conda-forge suitesparse`.)
(cuda-toolkit[^1] must be available, e.g. `conda install -c nvidia/label/cuda-12.4.0 cuda-toolkit`.)

Look into docs/installation.md for more details.

## Acknowledgment

The code in this repository was created as part of the research project “GRAVITON”, supported by the German Federal Ministry for Economic Affairs and Climate Action (BMWE) on the basis of a decision by the German Bundestag (grant no. 03EIM4109).

<img alt="Supported by: Federal Ministry for Economic Affairs and Energy on the basis of a decision by the German Bundestag" src="https://github.com/e2nIEE/parallel-pandapower-solver/blob/main/docs/BMWE_gefoerdert_en_RGB.png" width="230" height="230" />

## Credits

This package was created with [Cookiecutter](https://github.com/audreyfeldroy/cookiecutter) and the [audreyfeldroy/cookiecutter-pypackage](https://github.com/audreyfeldroy/cookiecutter-pypackage) project template.

---
[^1]: CUDA libraries are not part of this repository and must be acquired separately from NVIDIA, under their respective license terms.
