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

Uploaded Source

File details

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

File metadata

  • Download URL: pystospa-2.0.22.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.22.tar.gz
Algorithm Hash digest
SHA256 09ca9bc9fa0c252b5c160a678927b142f4d0942b82634f51d7c36049d78b2255
MD5 f5b47c73c1ae348456299888b4c8f35b
BLAKE2b-256 713d03d0e48a94274fd51de06d09430232cb0433918eaf5597e5351b4932f373

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

This release

2.0.22 This release

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