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.29.tar.gz (719.3 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: pystospa-2.0.29.tar.gz
  • Upload date:
  • Size: 719.3 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.29.tar.gz
Algorithm Hash digest
SHA256 c21da5149b2c0c561fc28708c78aa9cfd15456ddf0f884e0021a5e638bef9bab
MD5 f54a9e3887e582c309d7effabed53012
BLAKE2b-256 0f6fc94415fc921f91132b5084ad823f8499f06fdb412e470942916ff46556f9

See more details on using hashes here.

Release history Release notifications | RSS feed

2.0.30

1 file

This release

2.0.29 This release

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

2.0.20

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