Lewis - Let's write intricate simulators!
Project description
Lewis
Lewis - Let's write intricate simulators.
Lewis is a Python framework for simulating hardware devices.
Lewis can be installed via pip or ran from source. See relevant usage sections of the docs for more details.
Lewis was previously named "Plankton" but, due to a package with the same name on PyPI, we decided to rename the project.
Lewis is licensed under GPL v3 or later.
Purpose and Use Cases
Lewis is being developed in the context of instrument control at the ESS, but it is general enough to be used in many other contexts that require detailed, stateful software simulations of hardware devices.
We consider a detailed device simulation to be one that can communicate using the same protocol as the real device, and that can very closely approximate real device behaviour in terms of what is seen through this protocol. This includes gradual processes, side-effects and error conditions.
The purpose of Lewis is to provide a common framework to facilitate the development of such simulators. The framework provides a common set of tools, including communication protocol services, which helps minimize code replication and allows the developer of a simulated device to focus on capturing device behaviour.
Potential use cases for detailed device simulators include:
- Replacing the physical device when developing and testing software that interfaces with the device
- Testing failure conditions without risking damage to the physical device
- Automated system and unit tests of software that communicates with the device
- Perform "dry runs" against test scripts that are to be run on the real device
Using a simulation for the above has the added benefit that, unlike most real devices, a simulation may be sped up / fast-forwarded past any lengthy delays or processes that occur in the device.
Features
Brief Terminology
Device\ s and Interface\ s are two independent concepts in
Lewis. The Device is model for the device behaviour and internal
memory. A Device can be represented using a StateMachine, but it
does not have to be. A Device does not include anything specific to
the communication protocol with the Device. An Interface
provides bindings from a protocol Adapter to a Device.
Common Adapter\ s, , such as TCP stream, Modbus and EPICS, are provided
by Lewis. The Device and Interface are instantiated as part of a
Simulation that provides a cycle "heart beat" and manages other
environmental aspects and services.
What Can You Do With Lewis?
- Create new
Device\ s to closely imitate the internal behaviour and memory of something - Optionally make a
Devicework as aStateMachineviaStateMachineDeviceto give rich behaviours - Create one or more
Interface\ s over yourDeviceto expose it as an EPICS IOC, a TCP listener, or on any other bespoke protocol you like - Access and control the
Devicewhile it is running via a control server - Access and control the
Simulationwhile it is running via a control server - Control server can be accessed via command-line utility, Python bindings, or JSON RPC.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lewis-1.3.5.tar.gz.
File metadata
- Download URL: lewis-1.3.5.tar.gz
- Upload date:
- Size: 220.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11db8a648f9c206b59764807a29e1924362c5dc0cab4aa99817a8cbbd18b1a13
|
|
| MD5 |
a362d52cbe76282b47f52de8794525c3
|
|
| BLAKE2b-256 |
366258f080a57abfa146479c313be1a739b4dd1f9e553d31af8e5776dd07723b
|
Provenance
The following attestation bundles were made for lewis-1.3.5.tar.gz:
Publisher:
release.yml on ISISComputingGroup/lewis
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lewis-1.3.5.tar.gz -
Subject digest:
11db8a648f9c206b59764807a29e1924362c5dc0cab4aa99817a8cbbd18b1a13 - Sigstore transparency entry: 184200564
- Sigstore integration time:
-
Permalink:
ISISComputingGroup/lewis@1ce985ddbd9524adb2b9a64ec814eeb289af1015 -
Branch / Tag:
refs/tags/v1.3.5 - Owner: https://github.com/ISISComputingGroup
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1ce985ddbd9524adb2b9a64ec814eeb289af1015 -
Trigger Event:
push
-
Statement type:
File details
Details for the file lewis-1.3.5-py3-none-any.whl.
File metadata
- Download URL: lewis-1.3.5-py3-none-any.whl
- Upload date:
- Size: 241.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35093c33a0d2e9f176929ede3aee772a23cc9bc80845aaad0079f9d03a07f12e
|
|
| MD5 |
10704ed281b1df33ec96335b9f73a96c
|
|
| BLAKE2b-256 |
e822f4705fa95794a2aa2610134aae4b0889ad87a70d85d5d3bbd8e9bfd4ac4e
|
Provenance
The following attestation bundles were made for lewis-1.3.5-py3-none-any.whl:
Publisher:
release.yml on ISISComputingGroup/lewis
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lewis-1.3.5-py3-none-any.whl -
Subject digest:
35093c33a0d2e9f176929ede3aee772a23cc9bc80845aaad0079f9d03a07f12e - Sigstore transparency entry: 184200572
- Sigstore integration time:
-
Permalink:
ISISComputingGroup/lewis@1ce985ddbd9524adb2b9a64ec814eeb289af1015 -
Branch / Tag:
refs/tags/v1.3.5 - Owner: https://github.com/ISISComputingGroup
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1ce985ddbd9524adb2b9a64ec814eeb289af1015 -
Trigger Event:
push
-
Statement type: