Skip to main content

Bridge between Tango and PyAML

Project description

tango-pyaml

Bridge between Tango Controls and PyAML

Overview

tango-pyaml is a Python bridge between the Tango control system and the PyAML abstraction layer for control systems. It provides a set of classes that allow Tango attributes and devices to be accessed and controlled using PyAML concepts.

This library is part of the Python Accelerator Middle Layer (PyAML) ecosystem.

Features

  • ✅ Read and write Tango attributes via a unified PyAML interface
  • 🔁 Support for read-only and read/write attributes
  • 📊 Grouped attribute operations using tango.Group
  • 💥 Exception mapping from Tango exceptions to PyAML exceptions
  • 🧹 Designed to integrate seamlessly with PyAML ControlSystem components
  • 🧪 Mocked devices for unit testing without Tango runtime

Installation

pip install tango-pyaml

Requirements

For development and testing:

pip install tango-pyaml[dev]

Usage Example

This is an example of an explicit call to a Tango attribute using PyAML. For more details about implicit declaration and broader configuration options, please refer to the PyAML documentation.

Configuration file attribute.yaml:

attribute: "sys/tg_test/1/float_scalar"
unit: "A"

Python code:

from tango.pyaml.attribute import Attribute
from tango.pyaml.tango_attribute import ConfigModel
import yaml

with open("attribute.yaml") as f:
    cfg_dict = yaml.safe_load(f)

cfg = ConfigModel(**cfg_dict)
attr = Attribute(cfg)

attr.set(10.0)
value = attr.get()
readback = attr.readback()

print(f"Value: {value}, Readback: {readback.value} [{readback.quality}]")

Available Classes

  • Attribute — Read/write access to a Tango attribute
  • AttributeReadOnly — Read-only attribute wrapper
  • AttributeList — Manage a group of attributes from multiple devices
  • TangoControlSystem — Adapter to configure global Tango control system context

Testing

Tests rely on mocked Tango devices and attributes using unittest.mock. To run tests:

pytest

Project Structure

  • tango.pyaml.attribute – Main attribute interface
  • tango.pyaml.attribute_read_only – Read-only attribute implementation
  • tango.pyaml.attribute_list – Attribute groups with tango.Group
  • tango.pyaml.tango_attribute – Base class wrapping attribute logic
  • mocked_device_proxy.py – In-memory mock for Tango DeviceProxy and AttributeProxy

License

This project is licensed under the MIT License.

Links

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_pyaml-0.3.2.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

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

tango_pyaml-0.3.2-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file tango_pyaml-0.3.2.tar.gz.

File metadata

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

File hashes

Hashes for tango_pyaml-0.3.2.tar.gz
Algorithm Hash digest
SHA256 a49828e09e15f5ec447ed586f8e126448a53a33f6bcb800c6abb3af9e0069269
MD5 4f9b8daaba61750deadc1ca6551e4ef4
BLAKE2b-256 feec7c4df4a9640dfac628805a49c62581613e23cad0d79a2e48ecb31c70a058

See more details on using hashes here.

Provenance

The following attestation bundles were made for tango_pyaml-0.3.2.tar.gz:

Publisher: deploy-pypi.yaml on python-accelerator-middle-layer/tango-pyaml

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

File details

Details for the file tango_pyaml-0.3.2-py3-none-any.whl.

File metadata

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

File hashes

Hashes for tango_pyaml-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 19b5064ea9fa318d092bbc386fa29a7787898a46540d9ea4af40b06a928d5b76
MD5 2edfe6586ffea3e252d7b12f89e9c1d1
BLAKE2b-256 4c0d863cb2a0332dc829d39441ad450a9d35df6aad73a09c1bfdb7e6606bfb2c

See more details on using hashes here.

Provenance

The following attestation bundles were made for tango_pyaml-0.3.2-py3-none-any.whl:

Publisher: deploy-pypi.yaml on python-accelerator-middle-layer/tango-pyaml

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