Skip to main content

Python-integrated GPU-enabled reaction-diffusion solver

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pigreads-1.0.0.tar.gz (2.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pigreads-1.0.0-py3-none-any.whl (84.3 kB view details)

Uploaded Python 3

File details

Details for the file pigreads-1.0.0.tar.gz.

File metadata

  • Download URL: pigreads-1.0.0.tar.gz
  • Upload date:
  • Size: 2.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for pigreads-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8a3fd82fe3877fbed8af4fb7652c9a15ffe94c1233f42c29130730fc6220bebc
MD5 7c5b795bc1d6db52ce073079d598f1b7
BLAKE2b-256 c07ef3ef047bf11b1bc9fb8883b1678fdf9ad537199aa7ceac427cc0de5471d4

See more details on using hashes here.

File details

Details for the file pigreads-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pigreads-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 84.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for pigreads-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b64ed571d5c28476b61f6dc655465852e1b9563a65d19ae6e3f58fc04c0dd450
MD5 385c5cce28b871af617e02b0a2773fc2
BLAKE2b-256 e8acff90e06dd910ff25fe8874df6a9f8ae04767450822698718b57330fa78c5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page