GraphModelParser
GraphModelParser is a Python library for representing and simulating dynamical graph models from a string description. The library supports various probability distributions such as normal, poisson, expon, binom, and uniform from the scipy.stats module.
Installation
You can install GraphModelParser from PyPI by running:
pip install graph-model-parser
Usage
from graph_model_parser import GraphModelParser
import numpy as np
# Set seed for reproducibility
np.random.seed(42)
model_description = '''
a_{t} = a_{t-1} + 1
b_{t} = b_{t-1} + 2*b_{t-2} + a_0
c_{t} = c_{t-1} + normal(1, 2)
'''
# Always enclose the dynamic time index in curly braces e.g. {t-1}
initial_values = {'a_0': 0, 'a_1': 1, 'b_0': 0, 'b_1': 1, 'c_0': 0}
model = GraphModelParser(model_description, initial_values)
print(model(t=20))
In this example, we define a simple dynamical graph model with three variables (a_{t}, b_{t}, and c_{t}) and their relationships over time. The c_{t} variable is also affected by a random normal distribution with a mean of 1 and a standard deviation of 2.
Features
- Define dynamical graph models using a simple string-based syntax.
- Support for various probability distributions from
scipy.stats, including normal, poisson, expon, binom, and uniform. - Easily compute the values of variables at specific time points.
- Define initial values for variables and model their evolution over time.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
Metadata
Release files for graph-model-parser 0.1.4
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 | Actions |
|---|---|---|---|---|
| graph-model-parser-0.1.4.tar.gz | 4.6 kB | Without provenance | Details for graph-model-parser-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| graph_model_parser-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for graph_model_parser-0.1.4-py3-none-any.whl |
Total release size: 10.2 kB
Release files / graph-model-parser-0.1.4.tar.gz
| Download URL | graph-model-parser-0.1.4.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
82d895f2bc103affe8c23771479ade1f5ae112e314e9eac8de18ee9f159d34a8
|
|
BLAKE2b-256 checksum How to use checksums |
3ed7c3a948bb438709988aaf023715ab7a3ae9ec56b75ae0139abe57e71ce536
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.6
|
Release files / graph_model_parser-0.1.4-py3-none-any.whl
| Download URL | graph_model_parser-0.1.4-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7402d5b7f5ebd38ae7a96fa21a26b2150c051beab78e7b610cce3863853865f5
|
|
BLAKE2b-256 checksum How to use checksums |
4006a3cff12be2591c6aa541f46b8af87f21077a792a8aaa08b4ece818ae84a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.6
|
Security for graph-model-parser 0.1.4
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.