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

Uploaded Source

File details

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

File metadata

  • Download URL: pystospa-2.0.23.tar.gz
  • Upload date:
  • Size: 774.5 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.23.tar.gz
Algorithm Hash digest
SHA256 316fe680dc71b6e9fb88e436123e06fc0b64217a8beebff9402c9da6fa3c421a
MD5 bb880e3bb662479059a7b47c7a1bd8d9
BLAKE2b-256 54d6a177b8539ebe5b01963497b8de858282f6badb6e3dc995f2be9a99ffb2b3

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

This release

2.0.23 This release

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