Skip to main content

SimPyLens: zero-invasion visualization and debugging toolkit for SimPy simulations

Project description

SimpyLens: Simpy Visualization and Debugging Toolkit

PyPI version Python versions License: MIT

SimpyLens is a low-intrusion toolkit for SimPy model visualization, debugging, and runtime inspection. It helps developers understand queueing behavior, resource contention, and process flow in real time without rewriting simulation business logic.

SimPy Visual Demos

Full Simulation Debugging Workflow

SimPy discrete-event simulation visualization and debugging workflow in SimpyLens

assets/pottery_factory.gif shows the full SimpyLens interface for discrete-event simulation debugging: runtime controls, process flow, resource movement, and live inspection. It is useful for users searching for a SimPy visual debugger, queueing simulation viewer, or simulation runtime inspection tool.

Manual Resource Layout for Process Storytelling

Manual resource layout for SimPy process flow visualization in SimpyLens

assets/manual_layout.gif demonstrates manual resource positioning so teams can present and analyze process flow with a clearer mental model. This is especially relevant for simulation demos, teaching, and operations reviews where layout readability matters.

Key Features

  • Real-time visualization for SimPy resources and process interactions.
  • Runtime controls for play, step, pause, reset, and speed.
  • Breakpoints with expression/callable conditions and edge modes.
  • Structured logs for simulation, step lifecycle, resources, and breakpoints.
  • Headless mode for tests and CI.
  • Optional metrics collection with read-only resource metrics.

Installation

pip install simpylens

Quickstart

import simpy
import simpylens


def model(env):
    server = simpy.Resource(env, capacity=1)

    def customer():
        with server.request() as req:
            yield req
            yield env.timeout(3)

    env.process(customer())


lens = simpylens.Lens(model=model, gui=True, seed=42)
lens.show()

SimPy Examples Included

Examples are in examples/ and grouped by origin.

Adapted from official simpy examples/tutorial lineage:

  • examples/bank_renege.py
  • examples/gas_station_refueling.py

Original SimpyLens examples:

  • examples/pottery_factory.py
  • examples/wafer_fabrication.py

FAQ

Is SimpyLens a SimPy debugger?

Yes. SimpyLens provides breakpoint-based debugging, structured event logs, and step-by-step runtime inspection for SimPy simulations.

Can I visualize SimPy resources in real time?

Yes. SimpyLens visualizes Resource, Container, and Store families, including queue/load behavior and process flow.

Can SimpyLens run in headless mode for automated testing?

Yes. Use Lens(gui=False) to run simulations and assertions in tests or CI pipelines.

Does SimpyLens require rewriting my simulation model?

No. SimpyLens is designed for low-intrusion integration with your existing SimPy setup function.

Contributing

Contributions are welcome.

Suggested workflow:

  1. Fork the repository.
  2. Create a feature branch.
  3. Add or update tests and examples.
  4. Submit a pull request with a clear change description.

Documentation

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

simpylens-0.1.6.tar.gz (138.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simpylens-0.1.6-py3-none-any.whl (131.2 kB view details)

Uploaded Python 3

File details

Details for the file simpylens-0.1.6.tar.gz.

File metadata

  • Download URL: simpylens-0.1.6.tar.gz
  • Upload date:
  • Size: 138.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for simpylens-0.1.6.tar.gz
Algorithm Hash digest
SHA256 fe87f02571010a4d64a7fd592682def26cb6731280799bde1a6eea7ce479423a
MD5 5a4c247536d3b1e40a9eee6a95f9c552
BLAKE2b-256 45d4bede5f1db3542ea054cc15c49af01afae9774b9067c0e9411d3c095ef5ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for simpylens-0.1.6.tar.gz:

Publisher: publish-pypi.yml on samuelc254/SimpyLens

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file simpylens-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: simpylens-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 131.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for simpylens-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 92efd74d4f5556a1b93a908584162b667df270c559d9c7c32b8d55a9af2a1914
MD5 c64ebce38f6b279d820a4bbd8f73813b
BLAKE2b-256 b62df0772f2396360fb194b16befc09d80e53d6c1b167796365bcb295b993e98

See more details on using hashes here.

Provenance

The following attestation bundles were made for simpylens-0.1.6-py3-none-any.whl:

Publisher: publish-pypi.yml on samuelc254/SimpyLens

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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