Skip to main content

UDA backend for xarray

Project description

uda-xarray

An xarray backend for UDA (Universal Data Access) that enables seamless integration of UDA data sources with the xarray ecosystem.

Overview

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.

Features

  • xarray Integration: Access UDA data using xarray's open_dataset function
  • 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

Installation

pip install uda-xarray

Or using uv:

uv pip install uda-xarray

Usage

Open 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>

Data Structure

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

Requirements

  • Python >= 3.11, < 3.13
  • uda >= 2.9.2
  • xarray >= 2025.12.0

Development

Setup

Clone the repository and install development dependencies:

git clone https://github.com/samueljackson92/uda-xarray.git
cd uda-xarray
uv sync

Running Tests

pytest tests/

Code Quality

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_xarray

Contributing

Contributions are welcome! Please ensure:

  1. Tests pass for any new functionality
  2. Code follows the project's style guidelines (ruff and pylint)
  3. Documentation is updated as needed

License

MIT License

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

uda_xarray-0.2.2.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

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

uda_xarray-0.2.2-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file uda_xarray-0.2.2.tar.gz.

File metadata

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

File hashes

Hashes for uda_xarray-0.2.2.tar.gz
Algorithm Hash digest
SHA256 5f2d119de845b30fa909823b4b05dc2cefc64fa34687b4fa1fa3ba83ade9e23c
MD5 8b10b125a7f4c2393d7dc9068a6aa2f8
BLAKE2b-256 f896535391e8fd3f07d5deb00a87fa784c9edb2d382b89f9555f1fb7beb3566a

See more details on using hashes here.

Provenance

The following attestation bundles were made for uda_xarray-0.2.2.tar.gz:

Publisher: publish.yml on samueljackson92/uda-xarray

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

File details

Details for the file uda_xarray-0.2.2-py3-none-any.whl.

File metadata

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

File hashes

Hashes for uda_xarray-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1febb48992cc52a74889c1c9ef7180c0f69ce630e065aa6ad0dd8e483b928dbd
MD5 a606612ce3c164500abb8d7353f9f60c
BLAKE2b-256 916622b07e95b6c93e516bb520186c51f7a19334814f01af244f6333340479f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for uda_xarray-0.2.2-py3-none-any.whl:

Publisher: publish.yml on samueljackson92/uda-xarray

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