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
ControlSystemcomponents - 🧪 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 attributeAttributeReadOnly— Read-only attribute wrapperAttributeList— Manage a group of attributes from multiple devicesTangoControlSystem— 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 interfacetango.pyaml.attribute_read_only– Read-only attribute implementationtango.pyaml.attribute_list– Attribute groups withtango.Grouptango.pyaml.tango_attribute– Base class wrapping attribute logicmocked_device_proxy.py– In-memory mock for TangoDeviceProxyandAttributeProxy
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
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 tango_pyaml-0.3.1.tar.gz.
File metadata
- Download URL: tango_pyaml-0.3.1.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c5cc0c2bf8f3adcf67709ab2aa6ecb4650d349fcec96d371261b7325f39f655
|
|
| MD5 |
fb1d7b9498817a9a0f4155a335c4a41e
|
|
| BLAKE2b-256 |
82895e09efad4bbd0b5308fcad1d8364b284010ccaf285f9e668deec5c946f15
|
Provenance
The following attestation bundles were made for tango_pyaml-0.3.1.tar.gz:
Publisher:
deploy-pypi.yaml on python-accelerator-middle-layer/tango-pyaml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tango_pyaml-0.3.1.tar.gz -
Subject digest:
9c5cc0c2bf8f3adcf67709ab2aa6ecb4650d349fcec96d371261b7325f39f655 - Sigstore transparency entry: 760868042
- Sigstore integration time:
-
Permalink:
python-accelerator-middle-layer/tango-pyaml@a8c708fe91bc0542a72ff4fca33bc7e629e4b8f2 -
Branch / Tag:
refs/tags/0.3.1 - Owner: https://github.com/python-accelerator-middle-layer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy-pypi.yaml@a8c708fe91bc0542a72ff4fca33bc7e629e4b8f2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file tango_pyaml-0.3.1-py3-none-any.whl.
File metadata
- Download URL: tango_pyaml-0.3.1-py3-none-any.whl
- Upload date:
- Size: 16.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79572ca353e1ab5da3df9d57f76c0844395aa6773dff73a602705c56d3f11b8b
|
|
| MD5 |
4e2eec916b4d6dd5bb65f49194d1229a
|
|
| BLAKE2b-256 |
99a1ee2990ba80c1d6f01e21b84104280fda492c51423109545a691c4e275f04
|
Provenance
The following attestation bundles were made for tango_pyaml-0.3.1-py3-none-any.whl:
Publisher:
deploy-pypi.yaml on python-accelerator-middle-layer/tango-pyaml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tango_pyaml-0.3.1-py3-none-any.whl -
Subject digest:
79572ca353e1ab5da3df9d57f76c0844395aa6773dff73a602705c56d3f11b8b - Sigstore transparency entry: 760868046
- Sigstore integration time:
-
Permalink:
python-accelerator-middle-layer/tango-pyaml@a8c708fe91bc0542a72ff4fca33bc7e629e4b8f2 -
Branch / Tag:
refs/tags/0.3.1 - Owner: https://github.com/python-accelerator-middle-layer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy-pypi.yaml@a8c708fe91bc0542a72ff4fca33bc7e629e4b8f2 -
Trigger Event:
push
-
Statement type: