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-0.5.5.tar.gz (3.7 MB view details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pigreads-0.5.5.tar.gz
Algorithm Hash digest
SHA256 14a3bfaf33a62aa978f8bfb629df1d9d192684c82f21a209fdbc8edda7b86c9e
MD5 e54320cefa10f31cec33f727ad2a4369
BLAKE2b-256 9473a5f800f8a1e3e0f36898321bd866ded1eb31c89d7186298f01a610d1301c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pigreads-0.5.5-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-0.5.5-py3-none-any.whl
Algorithm Hash digest
SHA256 96a2313127ec30ea3dc2c3379da89e559568b6e4804f975183276aa10a162e9c
MD5 81b868512525423f49f2aa55fcbf6fcf
BLAKE2b-256 a65b7a793985e1e3563d33f0ddae84568abf2b12bec5b8360016021dda8a6967

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