lewis.scripts.run

This script is the main interaction point of the user with Lewis. The usage is as follows:

usage: lewis [-s SETUP] [-n | -p ADAPTER_OPTIONS] [-l] [-L] [-i]
             [-k DEVICE_PACKAGE] [-a ADD_PATH] [-c CYCLE_DELAY] [-e SPEED]
             [-r RPC_HOST] [-o {none,critical,error,warning,info,debug}] [-V]
             [-I] [-v] [-h] [-R]
             [device]

This script starts a simulated device that is exposed via the specified
communication protocol. Complete documentation of Lewis is available in the
online documentation on GitHub https://github.com/ess-dmsc/lewis/

Positional arguments:
  device                Name of the device to simulate, omitting this argument
                        prints out a list of available devices.

Device related parameters:
  Parameters that influence the selected device, such as setup or protocol.

  -s SETUP, --setup SETUP
                        Name of the setup to load. If not provided, the
                        default setup is selected. If thereis no default, a
                        list of setups is printed.
  -n, --no-interface    If supplied, the device simulation will not have any
                        communication interface.
  -p ADAPTER_OPTIONS, --adapter-options ADAPTER_OPTIONS
                        Supply the protocol name and adapter options in the
                        format "name:{opt1: val, opt2: val}". Use the -l flag
                        to see which protocols are available for the selected
                        device. Can be supplied multiple times for multiple
                        protocols.
  -l, --list-protocols  List available protocols for selected device.
  -L, --list-adapter-options
                        List available configuration options and their value.
                        Values that have not been modified in the -p argument
                        are default values.
  -i, --show-interface  Show command interface of device interface.
  -k DEVICE_PACKAGE, --device-package DEVICE_PACKAGE
                        Name of packages where devices are found.
  -a ADD_PATH, --add-path ADD_PATH
                        Path where the device package exists. Is added to the
                        path.

Simulation related parameters:
  Parameters that influence the simulation itself, such as timing and speed.

  -c CYCLE_DELAY, --cycle-delay CYCLE_DELAY
                        Approximate time to spend in each cycle of the
                        simulation. 0 for maximum simulation rate.
  -e SPEED, --speed SPEED
                        Simulation speed. The actually elapsed time between
                        two cycles is multiplied with this speed to determine
                        the simulated time.
  -r RPC_HOST, --rpc-host RPC_HOST
                        HOST:PORT format string for exposing the device and
                        the simulation via JSON-RPC over ZMQ. Use lewis-
                        control to access this service from the command line.

Other arguments:
  -o {none,critical,error,warning,info,debug}, --output-level {none,critical,error,warning,info,debug}
                        Level of detail for logging to stderr.
  -V, --verify          Sets the output level to 'debug' and aborts before
                        starting the device simulation. This is intended to
                        help with diagnosing problems with devices or input
                        arguments.
  -I, --ignore-versions
                        Ignore version mismatches between device and
                        framework. A warning will still be logged.
  -v, --version         Prints the version and exits.
  -h, --help            Shows this help message and exits.

Deprecated arguments:
  -R, --relaxed-versions
                        Renamed to --I/--ignore-versions. Using this old
                        option produces an error and it will be removed in a
                        future release.

Members

parse_adapter_options

run_simulation

This is effectively the main function of a typical simulation run.

lewis.scripts.run.run_simulation(argument_list=None) None[source]

This is effectively the main function of a typical simulation run. Arguments passed in are parsed and used to construct and run the simulation.

This function only exits when the program has completed or is interrupted.

Parameters:

argument_list – Argument list to pass to the argument parser declared in this module.