Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
8ca4654
Add catalog support to Tango control system
gupichon-soleil Apr 21, 2026
334f388
Add Tango direct attribute catalog
gupichon-soleil Apr 21, 2026
77b0a5c
Add static catalog (tango.pyaml.static_catalog) and indexed attribute…
gupichon-soleil Apr 24, 2026
c677ebb
Missing files in the last commit
gupichon-soleil Apr 24, 2026
65267f7
Merge AttributeIndexed into Attribute by making index optional, remov…
gupichon-soleil Apr 24, 2026
3558d5a
Fix TangoCatalog control-system binding
gupichon-soleil Apr 29, 2026
76946c4
Adapt Tango catalog resolution to new PyAML backend contract
gupichon-soleil May 4, 2026
bea5df4
Annotation correction for logging level
gupichon-soleil May 19, 2026
19272ba
Merge pull request #32 from python-accelerator-middle-layer/31-wrong-…
gupichon May 19, 2026
fa9f72c
Adapting the catalog mechanism.
gupichon-soleil Jun 11, 2026
ae4bb78
Remove unused elements
gupichon-soleil Jun 11, 2026
27fb318
Merge remote-tracking branch 'origin/main' into 29-adding-a-field-for…
gupichon-soleil Jun 11, 2026
3a207a9
Put back mandatory methods
gupichon-soleil Jun 11, 2026
b96d164
Adapting to the new DeviceAccessList interface.
gupichon-soleil Jun 12, 2026
f497d92
Adapting to the new DeviceAccessList interface.
gupichon-soleil Jun 12, 2026
61f6dda
Adapting to the new DeviceAccessList interface.
gupichon-soleil Jun 12, 2026
8f5f342
Merge pull request #30 from python-accelerator-middle-layer/29-adding…
JeanLucPons Jun 12, 2026
020e6a0
Rename get_device() to get_device_access() for clarity
gupichon-soleil Jun 15, 2026
36e7c13
Adapting tests and comments
gupichon-soleil Jun 15, 2026
13b5673
Merge pull request #34 from python-accelerator-middle-layer/33-rename…
JeanLucPons Jun 16, 2026
76c3488
Remove config models from attribute list.
TeresiaOlsson Sep 8, 2026
c46382e
Remove config models from attribute.
TeresiaOlsson Sep 8, 2026
d52ad4f
Remove config model from controlsystem.
TeresiaOlsson Sep 8, 2026
39289f4
Remove config models from multi attribute.
TeresiaOlsson Sep 8, 2026
1b569be
Remove config models from static catalog.
TeresiaOlsson Sep 8, 2026
9f02866
Remove config models from tango catalog.
TeresiaOlsson Sep 8, 2026
8f2aed8
Remove config models from readme and error messages.
TeresiaOlsson Sep 8, 2026
a0fbaa8
Add entrypoint so schemas can be discovered by the pyaml core.
TeresiaOlsson Sep 8, 2026
124b681
Ruff fixes.
TeresiaOlsson Sep 8, 2026
45201fd
Ruff fixes.
TeresiaOlsson Sep 8, 2026
06fe4f5
Temporarily updated the workflow so tests are run against the pyaml m…
TeresiaOlsson Sep 9, 2026
9b4a438
Add copier to dev dependencies.
TeresiaOlsson Sep 9, 2026
b1d3bc1
Merge pull request #35 from python-accelerator-middle-layer/change-sc…
gupichon Sep 9, 2026
a288388
Add docs.
TeresiaOlsson Sep 9, 2026
01f6831
Update readme.
TeresiaOlsson Sep 9, 2026
c1135d8
Add copier answers.
TeresiaOlsson Sep 9, 2026
e98b501
Modified readme.
TeresiaOlsson Sep 9, 2026
397c5b4
Merge branch 'main' into api-documentation
TeresiaOlsson Sep 9, 2026
d0ab2a0
Fix bug with attributes in multi attribute.
TeresiaOlsson Sep 9, 2026
af47ecc
Changes for dynamic versioning.
TeresiaOlsson Sep 9, 2026
9095663
Merge pull request #36 from python-accelerator-middle-layer/api-docum…
TeresiaOlsson Sep 9, 2026
1f01073
Merge pull request #37 from python-accelerator-middle-layer/fix-bug-i…
JeanLucPons Sep 10, 2026
b177701
Merge pull request #38 from python-accelerator-middle-layer/dynamic-v…
gupichon Sep 10, 2026
c19b37a
Add workflow for github release.
TeresiaOlsson Sep 10, 2026
902cb8c
Merge pull request #40 from python-accelerator-middle-layer/github-re…
gupichon Sep 10, 2026
c31a314
Add numpy-style docstrings to all modules
GamelinAl Sep 11, 2026
7455b85
Merge pull request #42 from python-accelerator-middle-layer/improve-d…
GamelinAl Sep 11, 2026
d90d014
Merge remote-tracking branch 'origin/main' into release-0.4.0
GamelinAl Sep 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: 0.1.0
_src_path: https://github.com/python-accelerator-middle-layer/pyaml-repository-template.git
distribution_name: tango-pyaml
html_title: tango-pyaml
import_name: tango.pyaml
package_name: tango-pyaml
repository_url: https://github.com/python-accelerator-middle-layer/tango-pyaml
use_docs_extra: false
4 changes: 2 additions & 2 deletions .github/workflows/deploy-pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
deploy:

runs-on: ubuntu-latest

#environment: release
Expand All @@ -27,7 +27,7 @@ jobs:
cache-dependency-path: '**/pyproject.toml'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade pip
pip install hatch
- name: Build package
run: hatch build
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/github-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: GitHub Release

on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+*'

permissions:
contents: write

jobs:
release:
name: Build and create release on GitHub
runs-on: ubuntu-latest

steps:
- name: Check out source
uses: actions/checkout@v5

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"

- name: Install Hatch
run: python -m pip install --upgrade hatch

- name: Build distribution
run: hatch build

- name: Determine whether this is a pre-release
id: release_type
shell: bash
run: |
tag="${GITHUB_REF_NAME#v}"

if [[ "$tag" =~ (\.dev[0-9]+|a[0-9]+|b[0-9]+|rc[0-9]+)$ ]]; then
echo "prerelease=true" >> "$GITHUB_OUTPUT"
else
echo "prerelease=false" >> "$GITHUB_OUTPUT"
fi

- name: Create GitHub release
uses: softprops/action-gh-release@v3
with:
draft: false
prerelease: ${{ steps.release_type.outputs.prerelease }}
generate_release_notes: true
files: dist/*
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
pip install accelerator-toolbox
pip install matplotlib
pip install h5py
pip install accelerator-middle-layer
pip install "git+https://github.com/python-accelerator-middle-layer/pyaml.git"
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST
**/_version.py

# PyInstaller
# Usually these files are written by a python script from a template
Expand All @@ -55,7 +56,7 @@ coverage.xml
.pytest_cache/
cover/

# DS
# DS
**/.DS_Store

# Translations
Expand Down
25 changes: 25 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version, and other tools you might need
build:
os: ubuntu-24.04
tools:
python: "3.13"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/source/conf.py

# Optionally, but recommended,
# declare the Python requirements required to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt
- method: pip
path: .
extra_requirements: []
81 changes: 18 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# tango-pyaml

**Bridge between **[**Tango Controls**](https://www.tango-controls.org/)** and PyAML**

**Bridge between **[**Tango Controls**](https://www.tango-controls.org/)** and pyAML**

[![Documentation Status](https://readthedocs.org/projects/tango-pyaml/badge/?version=latest)](https://tango-pyaml.readthedocs.io/en/latest/?badge=latest)
[![Current release](https://img.shields.io/github/v/release/python-accelerator-middle-layer/tango-pyaml)](https://github.com/python-accelerator-middle-layer/tango-pyaml/releases)

## Overview

`tango-pyaml` is a Python bridge between the [Tango control system](https://www.tango-controls.org/) and the [PyAML](https://github.com/python-accelerator-middle-layer/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.
`tango-pyaml` is a Python bridge between the [Tango control system](https://www.tango-controls.org/) and the [pyAML](https://github.com/python-accelerator-middle-layer/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.

## Features

Expand All @@ -21,82 +20,38 @@ This library is part of the **Python Accelerator Middle Layer (PyAML)** ecosyste

## Installation

Install the package from PyPI:

```bash
pip install tango-pyaml
```

## Requirements
## Development

- Python >= 3.9
- [PyTango](https://pytango.readthedocs.io/en/latest/) >= 9.5.1
- [PyAML](https://github.com/python-accelerator-middle-layer/pyaml)
- [pydantic](https://docs.pydantic.dev/) >= 2.0

For development and testing:
Install the development dependencies with:

```bash
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](https://github.com/python-accelerator-middle-layer/pyaml).

Configuration file `attribute.yaml`:

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

Python code:

```python
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:
Run the test suite with:

```bash
pytest
```

## Project Structure
Install the pre-commit hooks with:

- `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`
```bash
pre-commit install
```

## License
## Documentation

This project is licensed under the MIT License.
The documentation is available at:

## Links
<https://tango-pyaml.readthedocs.io/en/stable/>

- 🧺 [Repository](https://github.com/python-accelerator-middle-layer/tango-pyaml)
## Contributing

Please use the issue tracker or submit a pull request.
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
4 changes: 4 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sphinx~= 8.1
pydata-sphinx-theme
myst_parser
sphinx-copybutton
Binary file added docs/source/_static/_images/dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/_images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/_images/logosmall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions docs/source/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.api-root h1 {
display: none;
}

.api-generation {
display: none;
}
Empty file added docs/source/_templates/.gitkeep
Empty file.
14 changes: 14 additions & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
API Reference
=============

.. container:: api-generation

.. autosummary::
:toctree: api
:recursive:

tango.pyaml

.. container:: api-root

.. include:: api/tango.pyaml.rst
Loading