Skip to main content

pystospa

Build Status Documentation Status

A Python binding of a C++ software package for stochastic simulations of spatially extended systems, StoSpa2. Code-base has been completely refactored since the previous version of StoSpa. Python bindings have also been included.

Installation

Easy way

pip install pystospa

Hard way

After cloning the following repository

git clone https://github.com/BartoszBartmanski/StoSpa2.git --recursive

do the following

cd StoSpa2
python setup.py install

This way of installing pystospa assumes the following packages are installed are met

  • scikit-build
  • setuptools
  • wheel
  • cmake

Example

Let's consider the following chemical reaction

A \rightarrow \emptyset

happening at rate k. The python code for this simulation is as follows

import pystospa as ss

v = ss.Voxel([100], 1.0)
r = ss.Reaction(1.0, lambda x, y : x[0], [-1])
v.add_reaction(r)

s = ss.Simulator([v])
s.run("example.dat", 0.01, 500)

After importing pystospa, we create the voxel and reaction objects with

v = ss.Voxel([100], 1.0)
r = ss.Reaction(1.0, lambda x, y : x[0], [-1])

and then we add the reaction object to the voxel object.

v.add_reaction(r)

And finally, we pass the voxel objects, contained in a list, to a simulator object

s = ss.Simulator([v])
s.run("example.dat", 0.01, 500)

and we invoke the run function of the Simulator class, to run a stochastic simulation saving the state every 0.01 seconds for 500 steps.

Download files

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

Source Distribution

pystospa-2.0.20.tar.gz (773.2 kB view details)

Uploaded Source

File details

Details for the file pystospa-2.0.20.tar.gz.

File metadata

  • Download URL: pystospa-2.0.20.tar.gz
  • Upload date:
  • Size: 773.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for pystospa-2.0.20.tar.gz
Algorithm Hash digest
SHA256 094c4581068201e4390682e6e3d53011ecfc9afdb7d83269c296d13969315ed5
MD5 959dbb0a2b94359430bb1be398f39f12
BLAKE2b-256 9d34dbcf1a0a4398f3a941f46f2cdac607e0f44f2352789a4cd8783e02b5cc50

See more details on using hashes here.

Release history Release notifications | RSS feed

2.0.30

1 file

2.0.29

1 file

2.0.28

1 file

2.0.26

1 file

2.0.25

1 file

2.0.24

1 file

2.0.23

1 file

2.0.22

1 file

2.0.21

1 file

This release

2.0.20 This release

1 file

2.0.19

8 files

2.0.18

7 files

2.0.17

7 files

2.0.16

7 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