Skip to main content

fast-helmpy

fast-helmpy is an open source package of power flow solvers.

This package contains a vectorized, ~16× faster implementation of the Holomorphic Embedding Load flow Method (HELM) and the Newton-Raphson (NR) algorithm. It is a fork of HELMpy (via vogt31337/HELMpy); the solver core was rewritten for speed (sparse/einsum recurrence, batched Padé, physical residual convergence check) and exposed as an array-based library API. See BENCHMARKS.md for the measured speedups and IMPROVEMENT_PLAN.md for the optimization history.

The import package is fast_helmpy (underscore); the distribution on PyPI is fast-helmpy (hyphen).

Installation

pip install git+https://github.com/e2nIEE/fast-helmpy.git

The core solver needs only numpy and scipy. Loading grids from .xlsx files and the Newton-Raphson solvers additionally need pandas/openpyxl: pip install fast-helmpy[xlsx].

Using fast-helmpy as a library

solve_helm solves a power flow directly from per-unit arrays — no files involved. Bus types follow the ppc/pypower convention (1 = PQ, 2 = PV, 3 = slack):

import numpy as np
from fast_helmpy import solve_helm

result = solve_helm(
    Ybus,          # (N, N) bus admittance matrix, dense or scipy.sparse
    Sbus,          # (N,) complex net power injection per bus (gen - load)
    bus_types,     # (N,) ints: 1=PQ, 2=PV, 3=slack (exactly one)
    V_specified,   # (N,) voltage magnitude setpoints (used at PV/slack)
    Qmin=Qmin, Qmax=Qmax,   # optional generator reactive limits per bus
    mismatch=1e-8,
)
if result.converged:
    V = result.V                    # complex bus voltages
    S = result.S_injection          # complex power injections
    print(result.n_coefficients, result.residual, result.switched_buses)

Calling it from pandapower takes a small adapter — the arrays already exist after any runpp attempt (or via pandapower.pd2ppc):

import numpy as np
import pandapower as pp
from fast_helmpy import solve_helm

net = ...                     # your pandapower net
try:
    pp.runpp(net)
except pp.LoadflowNotConverged:
    ppc = net._ppc
    internal = ppc["internal"]
    Ybus, Sbus = internal["Ybus"], internal["Sbus"]
    bus_types = np.ones(len(Sbus), dtype=int)
    bus_types[internal["pv"]] = 2
    bus_types[internal["ref"]] = 3
    result = solve_helm(Ybus, Sbus, bus_types, np.abs(internal["V0"]),
                        slack_angle_degrees=net.ext_grid.va_degree.iloc[0])
    # result.V is a robust start vector: pp.runpp(net, init_vm_pu=..., init_va_degree=...)

Solver progress is reported through the fast_helmpy logging logger (no prints in library mode). Since fast-helmpy is used as a separate library here, its AGPL license does not affect the license of the calling code base.

Repository structure

  • data: sample data of large-sized, complex practical grids for testing purposes. Already computed results can also be found
  • helmm: matlab files for downloading and parsing to .xlsx matpower grids
  • fast_helmpy: scripts with core functionality
  • test: pytest regression suite (pytest -m "not slow" for the fast gate)
  • benchmark: wall-clock benchmark harness (see BENCHMARKS.md)

Compatibility

This package requires Python >= 3.9 and is tested on 3.10–3.13.

History

This package was developed by Tulio Molina and Juan José Ortega as a part of their thesis research to obtain the degree of Electrical Engineer at Universidad de los Andes (ULA) in Mérida, Venezuela.

HELMpy Guide

Please refer to HELMpy user's guide.pdf.

License - AGPLv3

HELMpy, open source package of power flow solvers developed on Python 3
Copyright (C) 2019 Tulio Molina tuliojose8@gmail.com and Juan José Ortega juanjoseop10@gmail.com

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Metadata

Release files for fast-helmpy 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fast-helmpy 0.4.0
File Size Uploaded
fast_helmpy-0.4.0.tar.gz 50.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fast-helmpy 0.4.0
File Interpreter ABI Platform
fast_helmpy-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 103.5 kB

Release files / fast_helmpy-0.4.0.tar.gz

Download URL fast_helmpy-0.4.0.tar.gz
Size 50.2 kB
Tags Source
SHA-256 checksum
How to use checksums
cf5f379c58ad503bc0209684b723869be56b73783c21bef134968e280d95accd
BLAKE2b-256 checksum
How to use checksums
f51034cc916dba9e81a7b3f73a46874a168f08d904b284f3c56fae51a112cf87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 10, 2026.

Transparency log

Release files / fast_helmpy-0.4.0-py3-none-any.whl

Download URL fast_helmpy-0.4.0-py3-none-any.whl
Size 53.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
da4bd8e3a01f2f41ec204aca4eeca2e24609b640059f954b099bdcdf507d0eed
BLAKE2b-256 checksum
How to use checksums
e3d1996c91416bdd9905d3595c3d9b2d8cbea96427368fbcb9e3f0a4e961e452
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 10, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page