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

Uploaded Source

File details

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

File metadata

  • Download URL: pystospa-2.0.26.tar.gz
  • Upload date:
  • Size: 774.7 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.26.tar.gz
Algorithm Hash digest
SHA256 095516ce19462cc439fcc9bd9bceeaa376de011e50b9e6b15a2305c648f0ced7
MD5 201f57fafa41f2c937736eaebffee541
BLAKE2b-256 49ff2b59477c3ea749ca2bbf2df9dc90b8b88ae36fc05640542ba08bf9e2cd81

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

This release

2.0.26 This release

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