Skip to main content

Pigreads

Pipeline Status Coverage Report Documentation Status

Latest Release PyPI platforms PyPI version

Pigreads is a streamlined, open-source Python module for efficient numerical solution of reaction–diffusion systems on graphics cards (GPUs), with CPU fallback. It exposes a minimal, concise, and NumPy-compatible API that allows users to define and run simulations while offloading the costly computations to accelerators via OpenCL kernels executed through PyOpenCL. The module supports 0D–3D uniform Cartesian grids, no-flux and periodic boundary conditions, anisotropic and spatially varying diffusion and reaction, and localised source terms. Pigreads includes several built-in models, including electrophysiology examples, while also allowing users to supply custom reaction terms, and is fully tested, documented, and distributed with examples and tutorials.

Peer-reviewed article

We have published a peer-reviewed article in Computer Physics Communications introducing Pigreads. It can be found at DOI 10.1016/j.cpc.2026.110088 or here. You may cite our article when using Pigreads:

Kabus, D., Dierckx, H., & De Coster, T. (2026). Pigreads: The Python-integrated GPU-enabled reaction-diffusion solver using OpenCL for cardiac electrophysiology and other applications. Computer Physics Communications, 110088.

@article{kabus2026pigreads,
  doi={10.1016/j.cpc.2026.110088},
  author={Desmond {Kabus} and Hans {Dierckx} and Tim {De Coster}},
  title={{Pigreads}: The {Python}-integrated {GPU}-enabled reaction-diffusion solver
    using {OpenCL} for cardiac electrophysiology and other applications},
  journal={Computer Physics Communications},
  pages={110088},
  year={2026},
  issn={0010-4655}
}

Getting started

Requirements

Pigreads uses OpenCL for calculations on the graphics cards. OpenCL is usually included in the drivers for your graphics card.

The following pages may help installing and accessing OpenCL:

You can use clinfo to verify you have an OpenCL platform installed.

If instead of the GPU, you want to use CPUs, you can install PoCL as an OpenCL platform to compute on the main processors.

Installation

Install this Python package in the standard way using pip, for instance from PyPI or from a local copy of this repository, see the Python documentation for details. To also install all optional dependencies, such as for the command line interface (CLI), run:

$ pip install pigreads[all] # from PyPI
$ pip install .[all] # from source

Note: If installing from source, you need to run python prepare.py first to render the code templates for the models that are defined as YAML in the models folder, and other preparation.

Usage

Simulations can be performed via calls to the Python module (API) or using the CLI. See the documentation for annotated examples, or the examples directory in the Pigreads repository.

Metadata

Release files for pigreads 1.0.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 pigreads 1.0.0
File Size Uploaded Provenance Actions
pigreads-1.0.0.tar.gz 2.6 MB Without provenance Details for pigreads-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pigreads 1.0.0
File Interpreter ABI Platform Actions
pigreads-1.0.0-py3-none-any.whl Python 3 none any Details for pigreads-1.0.0-py3-none-any.whl

Total release size: 2.7 MB

Release files / pigreads-1.0.0.tar.gz

Download URL pigreads-1.0.0.tar.gz
Size 2.6 MB
Tags Source
SHA-256 checksum
How to use checksums
8a3fd82fe3877fbed8af4fb7652c9a15ffe94c1233f42c29130730fc6220bebc
BLAKE2b-256 checksum
How to use checksums
c07ef3ef047bf11b1bc9fb8883b1678fdf9ad537199aa7ceac427cc0de5471d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / pigreads-1.0.0-py3-none-any.whl

Download URL pigreads-1.0.0-py3-none-any.whl
Size 84.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b64ed571d5c28476b61f6dc655465852e1b9563a65d19ae6e3f58fc04c0dd450
BLAKE2b-256 checksum
How to use checksums
e8acff90e06dd910ff25fe8874df6a9f8ae04767450822698718b57330fa78c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Security for pigreads 1.0.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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