pystospa
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.
Metadata
Release files for pystospa 2.0.30
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pystospa-2.0.30.tar.gz | 719.8 kB | Without provenance | Details |
Release files / pystospa-2.0.30.tar.gz
| Download URL | pystospa-2.0.30.tar.gz |
|---|---|
| Size | 719.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c8e155da00a8e6f537b29baf80dfac4058e1b703b5e63d24b677ae30d2036aa8
|
|
BLAKE2b-256 checksum How to use checksums |
6fdca8c50f8b70f0661c137d291437b5b915b624fba79497141f218bb67a659a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for pystospa 2.0.30
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.