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.3.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.3-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: uda_xarray-0.2.3.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.3.tar.gz
Algorithm Hash digest
SHA256 1af47f6171b6f2179da403b10743d653c3c063e7aa5c8d9c42fa95952f58d0dc
MD5 432e07922f9cff471cd4e146003e62ed
BLAKE2b-256 ef7772ec47d26ef8e8f409c4e1b7e8cfa3c1ed79da0c14015376cf3e2be7de73

See more details on using hashes here.

Provenance

The following attestation bundles were made for uda_xarray-0.2.3.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.3-py3-none-any.whl.

File metadata

  • Download URL: uda_xarray-0.2.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 96b8742152c97a5682d7bb600ba02309d49b41726e53d6aa8a94deb5d0a46e8e
MD5 07b270f451dfd059c75cbf2a9d49eabd
BLAKE2b-256 7f742a80a3d87954364cd6f33c300e5a5968229aeea0e80ea4f502a041910ef1

See more details on using hashes here.

Provenance

The following attestation bundles were made for uda_xarray-0.2.3-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