Skip to main content
# stocal

A python framework for regular and rule-based stochastic simulations.


## What is Stocal?

Stocal is a framework for stochastic simulation of continuous
time Markov processes (also known as [Gillespie simulations](https://en.wikipedia.org/wiki/Gillespie_algorithm)).

Features of stocal:
* support for reactions of any order
* support for unique and periodic (deterministic) events
* support for time-dependent reaction rates
* support for rules that generate novel reactions on the fly
* support for complex chemical states

Stocal works with python version 2.7 as well as version 3.5.


### Basic Usage

Running a simple stochastic simulation is straight forward:
```python
import stocal

# Define a stochastic process
process = stocal.Process([
stocal.MassAction({'A': 2}, {'A2': 1}, 1.0),
stocal.MassAction({'A2': 1}, {'A': 2}, 10.0),
stocal.Event({}, {'A': 100}, 0.0, frequency=10.0),
])

# Sample a stochastic trajectory of the process
initial_state = {}
trajectory = process.sample(initial_state, tmax=100) :
for dt, transitions in trajectory:
print trajectory.time, trajectory.state['A2']
```


### API / Tutorial

A tutorial on how to use stocal can be found [here](https://github.com/harfel/stocal/wiki).
Various usage examples are provided in stocal/examples.
The package API is thoroughly documented and can be accessed through
pydoc. The behavior of stocal is specified via tests. The test suite
can be run with `python setup.py test`.


### Installation

The latest stable release of stocal is available from the python package index:
```shell
pip install stocal
```
The development version can be obtained from github using the following commands:
```shell
git clone https://github.com/harfel/stocal.git
cd stocal
git checkout develop
sudo python setup.py install
```


## Issue Reporting and Contributing

Please post any issues that might occur with stocal on the
<a href="https://github.com/harfel/stocal/issues">github issue
tracker</a>.
If you are interested in contributing to stocal, pull requests
and any other inquiries will be dealt with as soon as possible.


## License

Stocal is distributed under the MIT Software license.
(c) 2018 Harold Fellermann

Metadata

Release files for stocal 1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stocal 1.2
File Size Uploaded Provenance Actions
stocal-1.2.tar.gz 68.8 kB Without provenance Details for stocal-1.2.tar.gz

Release files / stocal-1.2.tar.gz

Download URL stocal-1.2.tar.gz
Size 68.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ca0a428e71b827c0636cda497677e54e19ad2bad2e4942f05476d462f137f5a9
BLAKE2b-256 checksum
How to use checksums
34f9d7d1ad61fb49cabab1ff717c0f0509d5eb2b9fdbd8a5ebec9255aa2cc885
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/2.7

Security for stocal 1.2

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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