Skip to content


Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

SpatialPy is a Python 3 package for simulation of spatial deterministic/stochastic reaction-diffusion-advection problems embedded in Lagrangian reference frame particle based fluid dynamics domain

This package is intended to replace the PyURDME software and will feature both a NSM solver for RDME simulation on static domains and a sSSA-SDPD particle based fluid dynamics solver as described in the publication "A hybrid smoothed dissipative particle dynamics (SDPD) spatial stochastic simulation algorithm (sSSA) for advection–diffusion–reaction problems" by Drawert, Jacob, Li, Yi, Petzold

PLEASE REGISTER AS A USER, so that we can prove SpatialPy has many users when we seek funding to support development. SpatialPy is part of the StochSS project.

PyPI - License PyPI - Python Version PyPI PyPI - Downloads

Table of contents


SpatialPy can be installed on your computer using different methods, as described below.

Using PyPI

On Linux, macOS, and Windows operating systems, you should be able to install SpatialPy with pip. Please review the official pip documentation for installation instructions and additional information.

Then, to install SpatialPy from the Python package repository, run the following command:

python3 -m pip install spatialpy --user --upgrade

Using the source code repository

As an alternative to getting it from PyPI, you can instruct pip to install SpatialPy directly from the GitHub repository:

python3 -m pip install --user --upgrade

As a final alternative, you can first use git to clone a copy of the SpatialPy source tree from the GitHub repository to your local computer disk, and then install SpatialPy using that copy:

git clone
cd SpatialPy
python3 -m pip install  .  --user --upgrade


SpatialPy provides simple object-oriented abstractions for defining a model of a biochemical system and simulating that model using efficient stochastic simulation algorithms. The basic steps to use SpatialPy are:

  1. Create a SpatialPy.Model containing molecular species, parameters, and reactions.
  2. Invoke the model's .run() method.

The run() method can be customized using keyword arguments to select different solvers, random seed, data return type and more. For more detailed examples on how to use SpatialPy, please see the Jupyter notebooks contained in the examples subdirectory.

Getting help

SpatialPy's online documentation provides more details about using the software. If you find any problem with SpatialPy or the documentation, please report it using the GitHub issue tracker for this repository. You can also contact Dr. Brian Drawert directly with questions and suggestions.


We would be happy to receive your help and participation with enhancing SpatialPy! Please follow the guidelines described in

New developments happen primarily in the develop branch. New releases are put in the main branch.

Main Branch Develop Branch
Build Status Build Status


SpatialPy is licensed under the GNU General Public License version 3. Please see the file LICENSE for more information.

Authors and history


This work has been funded by National Institutes of Health (NIH) NIBIB Award No. 2R01EB014877-04A1.

SpatialPy uses numerous open-source packages, without which it would have been effectively impossible to develop this software with the resources we had. We want to acknowledge this debt. In alphabetical order, the packages are:

  • Jupyter – web application for creating documents containing code, visualizations and narrative text
  • MatplotLib – Python plotting library
  • Plotly – Graphing library for making interactive, publication-quality graphs
  • Numpy – the fundamental package for scientific computing with Python
  • Scipy – Python-based ecosystem of open-source software for mathematics, science, and engineering

Finally, we are grateful for institutional resources made available by the University of North Carolina at Asheville, the University of California at Santa Barbara, Uppsala University, and the California Institute of Technology.



Simulation of spatial deterministic/stochastic reaction-diffusion-advection problems embedded in Lagrangian reference frame particle based fluid dynamics domain



Code of conduct