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.1.tar.gz (7.3 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.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: uda_xarray-0.2.1.tar.gz
  • Upload date:
  • Size: 7.3 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.1.tar.gz
Algorithm Hash digest
SHA256 4cb37bfb83e1fa7fa98568467e3f91c5a9fc3134cc67d7b0cda3d0d69f06cb4a
MD5 cc12558de5c8e932ab2a56d068963980
BLAKE2b-256 55b3d0ba679d9d6de29d6560f02c516b4bd41ac5c251dd32d41c5278990f9b18

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: uda_xarray-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 5.4 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0ded2170248074f4371e70f55c5eff24cd89eff3ebb4dad6a6a4149c7d2d8408
MD5 efcbe54468c5fb931647c2e706a99061
BLAKE2b-256 4bbc43e835f92d64613b28d7dfc45b7b2aa2295f6950fa91621407de86100a9a

See more details on using hashes here.

Provenance

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