An xarray backend for UDA (Universal Data Access) that enables seamless integration of UDA data sources with the xarray ecosystem.
uda-xarray provides a backend plugin for xarray that allows you to access UDA data sources using xarray's familiar API. It automatically handles the conversion of UDA signals to xarray DataArrays and Datasets, making it easy to work with UDA data in scientific Python workflows.
- xarray Integration: Access UDA data using xarray's
open_datasetfunction - Automatic Conversion: Converts UDA signals to xarray DataArrays with proper coordinates and metadata
- Error Handling: Includes error data alongside signal data
- URI-based Access: Simple URI scheme (
uda://signal_name:shot) for accessing data
pip install uda-xarrayOr using uv:
uv pip install uda-xarrayOpen a UDA dataset using xarray:
import xarray as xr
# Open a UDA signal by name and shot number
ds = xr.open_dataset("uda://ip:30421", engine="uda")
# Access the data
data = ds["data"]
errors = ds["error"]
# The dataset includes time coordinates
time = ds["time"]
# Access metadata
units = ds["data"].attrs["units"]
signal_name = ds["data"].attrs["uda_name"]The URI format is: uda://<signal_name>:<shot_number>
When you open a UDA dataset, uda-xarray creates an xarray Dataset with:
- data: The signal data as a DataArray
- error: The error data as a DataArray
- time: Time coordinates (dimension)
- attrs: Metadata including units and UDA signal name
- Python >= 3.11, < 3.13
- uda >= 2.9.2
- xarray >= 2025.12.0
Clone the repository and install development dependencies:
git clone https://github.com/samueljackson92/uda-xarray.git
cd uda-xarray
uv syncpytest tests/The project uses ruff for linting and formatting, and pylint for additional checks:
# Run ruff
uv run ruff check uda_xarray tests
uv run ruff format uda_xarray tests
# Run pylint
uv run pylint uda_xarrayContributions are welcome! Please ensure:
- Tests pass for any new functionality
- Code follows the project's style guidelines (ruff and pylint)
- Documentation is updated as needed
MIT License