Skip to main content

Generic library for creating simulated TANGO devices.

Project description

tango-simlib: Easily generate TANGO device simulators

Main website: http://tango-simlib.readthedocs.io

Introduction

tango-simlib is a library that aids the data-driven development of TANGO device simulators. It aims to make it easy to develop basic simulators while making it possible to implement more complex simulators. In addition to the simulated device interface, a separate TANGO simulation-control interface is generated, allowing the simulator to be manipulated via a back-channel to simulate e.g. failure conditions on the simulated device interface.

Using only the basic TANGO interface description captured via a POGO generated XMI file, a basic simulator with randomly varying attributes and no-op command handlers can be generated with no further coding. Attribute simulation parameters and simple command behaviour can be specified using a Simulator Description Datafile (SimDD). The format of this file is currently a working proposal and subject to change. A more formal format specification is being worked on.

Note that tango-simlib does not generate simulator code. Rather, the simulator’s behaviour is driven by the description data at run-time using Python’s dynamic programming features. If the description files (XMI or SimDD) are modified, the simulator device server only needs to be restarted for the changes to take effect.

Basic Usage

Installation

Please Note

  • tango-simlib is compatible with Python2.7 and Python>=3.5.

  • Installation requires the TANGOBINARY prerequisites to be installed.

$ sudo apt-get install -y --no-install-recommends $(grep -vE "^\s*#" apt-build-requirements.txt | tr "\n" " ")

If you cannot install the PyTango package you will not be able to install tango-simlib. For more, documentation.

Installation from source, working directory where source is checked out

$ pythonX -m pip install . # Where 'x' is the version of Python

This package is available on PYPI, allowing

$ pip install tango-simlib

Tango-YAML

After installing tango_simlib, the tango-yaml script will be available to use

$ tango-yaml -h

usage: tango_yaml [-h] {xmi,fandango,tango_device,validate} ...

This program translates various file formats that describe Tango devices to
YAML. Or validates the conformance of a device against a specification.

positional arguments:
{xmi,fandango,tango_device,validate}
                        sub command help
    xmi                 Build YAML from a XMI file
    fandango            Build YAML from a fandango file
    tango_device        Build YAML from a running Tango device
    validate            Check conformance of a Tango device against a
                        specification in YAML format

optional arguments:
-h, --help            show this help message and exit

Documentation

Check out the documentation for more information. Download Manual: https://media.readthedocs.org/pdf/tango-simlib/latest/tango-simlib.pdf

License

This project is licensed under the BSD 3-Clause License - see license for details.

Contribute

Contributions are always welcome! Please ensure that you adhere to our coding standards CAM_Style_guide.

Changelog

0.7.0

  • Updated CHANGELOG in 122

  • Added validate option to tango-yaml tool in 121
    • This sub command enables conformance verification of a running Tango device against a specification file.

0.6.0

  • Updated CHANGELOG in 118

  • Added tango-yaml tool in 119
    • This tool translates fandango (fgo), XMI (xmi) or a running Tango device to YAML.

    • Once installed, run tango-yaml -h for details.

0.5.0

  • Added Weather.xmi to MANIFEST.in 117

  • Refactor the code base 116

  • Update compat function docstrings 115

0.4.0

  • Added Python2.7 and Python>=3.5 Compatibility Pull Request 110.

  • Formatted code with black

  • Added some missing XMI parser types Pull Request 101.

0.3.0

  • Support multiple device and control interfaces per server process (Enhancement)
    • Addressing issue raised in 56

  • Adding a log when writing to the attributes

  • Reduced the unnecessary logging of the TANGO device

  • Handle non scalar value
    • Linked to the Pull Request 91

0.2.1

  • Supporting more tango data types.
    • DevUChar

    • DevShort

    • DevUShort

    • DevLong64

    • DevULong64

    • DevState

    • DevEncoded

  • Updating documentation. Addresses issue 79.

0.2.0

  • Adding support to register and run a TANGO device using a file as a database.

  • Initialising the model quantity values with the default values specified in the simulator data description files.

  • Parsing simulator data description files in a pre-determined precendence order.

  • Removing unmaintained python-devicetest dependency.

  • Added a fandango json parser
    • This parser is used to process the TANGO device data file generated by the fandango library.

  • Making use of the PyTango v9.2.2 feature to create dynamic commands.

0.1.6

  • Force all unicode attributes in XMI files to byte strings.

0.1.5

  • Updates to the SimDD
    • Added a new type of behaviour in the side-effect actions suite for long-running commands.

  • Handle vector data type from pogo

  • Populate tango-db with device properties

0.1.4

  • Package release documentation

  • Updated console script names
    • tango-simlib-tango-launcher -> tango-simlib-launcher

    • tango-simlib-tango-simulator-generator -> tango-simlib-generator

0.1.3

  • DISH config files included in examples of device simulators

  • JSON Schema for SimDD configuration file validation

0.1.2

  • Modified the update method of the Model class to invoke the override pre-update and post-update method, respectively.

0.1.1

  • Handle DevEnum data type TANGO attributes

  • Handle Spectrum data format TANGO attributes

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

tango_simlib-0.7.0.tar.gz (107.9 kB view details)

Uploaded Source

Built Distributions

tango_simlib-0.7.0-py3-none-any.whl (128.2 kB view details)

Uploaded Python 3

tango_simlib-0.7.0-py2-none-any.whl (124.8 kB view details)

Uploaded Python 2

File details

Details for the file tango_simlib-0.7.0.tar.gz.

File metadata

  • Download URL: tango_simlib-0.7.0.tar.gz
  • Upload date:
  • Size: 107.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0.post20200106 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.6

File hashes

Hashes for tango_simlib-0.7.0.tar.gz
Algorithm Hash digest
SHA256 292c40dd5cec6d413d8b33f86a9e513f3406db72eb4bf8379d2a696fe28264fe
MD5 3a544d395f93ad4ee604b974fb1e5833
BLAKE2b-256 aa50b7a37b1dcf83774adfa9aea005ba4c74e2bc46052d59bb0e5ae7f1665cf0

See more details on using hashes here.

File details

Details for the file tango_simlib-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: tango_simlib-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 128.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0.post20200106 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.6

File hashes

Hashes for tango_simlib-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5edcd36c314eaed0b72c409501bb96b6f06caf279d370d742cda9c7c2f986384
MD5 1aeb34f6e573c021ea4e381073a32997
BLAKE2b-256 3146f7f2d79fbf7c280c6deb8180cbd9550d8c4c1ae00c594f8e9170acbc9d8b

See more details on using hashes here.

File details

Details for the file tango_simlib-0.7.0-py2-none-any.whl.

File metadata

  • Download URL: tango_simlib-0.7.0-py2-none-any.whl
  • Upload date:
  • Size: 124.8 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0.post20200106 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.6

File hashes

Hashes for tango_simlib-0.7.0-py2-none-any.whl
Algorithm Hash digest
SHA256 2918e88d8f058d2423d6da0b4decda2790bea64e3852b0000c107c92d52d5b76
MD5 0f8629377fb4f1d9fec7b46554958e20
BLAKE2b-256 3d7b8413adb71cd88a8b68464cc06c0d73df46fbfc5d6c3be2a78cb414c584c4

See more details on using hashes here.

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