Python solution for Stochastics
Project description
Welcome to stochastics
A simple library to help solving stochastic processes and finding resulting probilities of common applications
Installation / How to use
To use this library is pretty easy. First you will need to install the library from PyPI. Make sure you are running Python version 3.8 or above:
pip install stochastics
The you can use the library in your own python code, like this:
from stochastics.models import MarkovChain
# define some initial values for a markov chain
initial_probabilities = [0.3, 0.4]
transition_matrix = [
[0.1, 0.9],
[0.7, 0.3],
]
# create the markov chain with the parameters
mc = MarkovChain(initial_probabilities, trans_matrix=transition_matrix)
# find the probability of ending up in a state given a sequence of steps
p = mc.get_probability_from_sequence(state_sequence=[0, 1, 0])
print(p)
More utilization examples and API documentation can be seem in the docs.
Development Setup
So you want to contribute to the development, that is very welcome! To develop this project there're only two initial requirements:
- Python 3.8+
- Having pip or pipenv installed
After making sure those requirements are fullfilled, you can simple run this command with pip
:
pip install -r requirements-dev.txt
If you like pipenv
, just do:
pipenv install --dev
That is already all you need. Just make sure to follow the Contribution Guidelines and you are all set.
After doing your work and getting ready to make your PR, I recommend you to use pre-commit
to fix some standards and make sure nothing really can get in the way of your contribution.
Run tests
There're tests in this project, and the best way to see how things work under the hood and check if you changes are ok, simply run the tests with pytest
:
pytest
You can also see if the current test coverage of the project is good by running:
pytest --cov
Need help? Found an bug? Have a good idea?
I encourage you to look around in the issues section, see if someone else is working on a fix for your problem, there's already a report for the bug, or some new feature being dicussed that you are interested. If you found nothing, feel free to create an issue using one of the provided templates.
Author
Robson Cruz
- Website: https://deadpyxel.github.io/
- Github: @deadpyxel
Show your support
Give a ⭐️ if this project helped you!
This README was generated with ❤️ by readme-md-generator
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file stochastics-0.4.0.tar.gz
.
File metadata
- Download URL: stochastics-0.4.0.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 867a7d75f8d68d6ced8d2c3d26175c713dbf6c54ab2a2df9ae9ffa84870cd881 |
|
MD5 | a65c6365976773b09d5bd70d7fe80327 |
|
BLAKE2b-256 | a0a43303a784fe47deacdce6aafc647c4c6bdd13f27eee0e033a91023bb8cd30 |
File details
Details for the file stochastics-0.4.0-py2.py3-none-any.whl
.
File metadata
- Download URL: stochastics-0.4.0-py2.py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c26dabc964b3a38a5bfdc4799da504a250f9884801947094cedaf5cc2a47b863 |
|
MD5 | 156ad836af85041b3a5e555a74d9ed99 |
|
BLAKE2b-256 | 75c5f40fe8df69468fde06db23775de40ae4536c1ebf967ef31d50f50304828a |