sal-xarray
An xarray backend for SAL (Simple Access Layer) that enables seamless integration of SAL data sources with the xarray ecosystem.
Overview
sal-xarray provides a backend plugin for xarray that allows you to access SAL data sources using xarray's familiar API. It automatically handles the conversion of SAL signals to xarray DataArrays and Datasets, making it easy to work with SAL data in scientific Python workflows.
Features
- xarray Integration: Access SAL data using xarray's
open_datasetfunction - Automatic Conversion: Converts SAL signals to xarray DataArrays with proper coordinates and metadata
- Status Mask Handling: Includes status mask data alongside signal data
- URI-based Access: Simple URI scheme (
sal://pulse/<shot_number>/<signal_name>) for accessing data
Installation
pip install sal-xarray
Or using uv:
uv pip install sal-xarray
JET data access requires a VPN connection to the JDC. You will also require a config file at ~/.sal/credentials with the following content:
[https://sal.jetdata.eu]
user=<user-name>
password=<password>
Usage
Open a SAL dataset using xarray:
import xarray as xr
# Open a SAL signal by name and shot number
ds = xr.open_dataset("sal://pulse/87737/ppf/signal/jetppf/magn/ipla", engine="sal")
# Access the data
data = ds["data"]
status = ds["status"]
# The dataset includes time coordinates
time = ds["time"]
# Access metadata
units = ds["data"].attrs["units"]
signal_name = ds["data"].attrs["sal_name"]
The URI format is: sal://pulse/<shot_number>/<signal_name>
Data Structure
When you open a SAL dataset, sal-xarray creates an xarray Dataset with:
- data: The signal data as a DataArray
- status: The status data as a DataArray
- time: Time coordinates (dimension)
- attrs: Metadata including units and SAL signal name
Development
Setup
Clone the repository and install development dependencies:
git clone https://github.com/samueljackson92/sal-xarray.git
cd sal-xarray
uv sync
Running Tests
uv run pytest tests/
Code Quality
The project uses ruff for linting and formatting, and pylint for additional checks:
# Run ruff
uv run ruff check sal_xarray tests
uv run ruff format sal_xarray tests
# Run pylint
uv run pylint sal_xarray
# Run ty
uv run ty check sal_xarray
Contributing
Contributions 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
License
MIT License
Release files for sal-xarray 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sal_xarray-0.2.2.tar.gz | 6.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sal_xarray-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.7 kB
Release files / sal_xarray-0.2.2.tar.gz
| Download URL | sal_xarray-0.2.2.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2120f2c2eac76fe9ed64c93bc8745a348d07453664f2f8b458b18a6add5f4c7c
|
|
BLAKE2b-256 checksum How to use checksums |
fa8f45dcaf3004362c39bb882f005bc316f9afc5e3f7504e9a67d8ef8e6605c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 20, 2026.
Transparency logRelease files / sal_xarray-0.2.2-py3-none-any.whl
| Download URL | sal_xarray-0.2.2-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
401e3074f184e9e6209756a5957b9a80902762b422381dffe04171bbd15c214a
|
|
BLAKE2b-256 checksum How to use checksums |
dc2d4b1c2f96a1fe3c3807966a30caf19ffb5a7a041ae836072eafd0cba31200
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 20, 2026.
Transparency log