Skip to main content

Minimalist discrete event simulator

Reason this release was yanked:

No longer supported

Project description

discrevpy: minimalist discrete event simulator

build codecov license: MIT

discrevpy is a minimalist discrete event simulator in Python. It makes use of function/method callbacks in its event execution. The discrevpy simulator does not implement any message passing and is thus exclusively single-threaded.

Installation

Python version: 3.7+

python3 -m pip install discrevpy

Getting started

Example usage:

from discrevpy import simulator

def something(value):
  print("t=" + str(simulator.now()) + ": something() with value " + str(value))

simulator.ready()
simulator.schedule(44, something, "ABC")
simulator.schedule(967, something, "XYZ")
simulator.end(10000)
simulator.run()
simulator.reset()

Documentation:

https://snkas.github.io/discrevpy/

Next steps:

Development

Requirements:

  • pytest (python3 -m pip install pytest)
  • coverage (python3 -m pip install coverage)
  • pylint (python3 -m pip install pylint)
  • sphinx (python3 -m pip install sphinx)
  • furo (python3 -m pip install furo)

Install latest development version:

  1. Clone the GitHub repository:
    git clone git@github.com:snkas/discrevpy.git
    
  2. Install locally using pip:
    cd discrevpy
    python3 -m pip install .
    

Run tests:

python3 -m pytest

Calculate coverage (outputs .coverage, coverage.xml and htmlcov/):

python3 -m coverage run --branch --omit="tests/*" -m pytest
python3 -m coverage xml
python3 -m coverage html

Pylint check:

python3 -m pylint discrevpy/*.py

Generate documentation (outputs HTML at docs/):

cd docsrc
make html

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

discrevpy-1.0.2.tar.gz (5.9 kB view hashes)

Uploaded Source

Built Distribution

discrevpy-1.0.2-py3-none-any.whl (7.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page