yt_xarray
An interface between yt and xarray
Overview
yt_xarray streamlines communication between xarray and yt, making it easier use yt's visualization and analysis methods with data loaded via xarray.
Presently, yt_xarray primarily adds methods to generate a yt dataset from a subset of xarray dataset fields, without making copies of data when possible.
For a more detailed description, check out the full documentation at https://yt-xarray.readthedocs.io.
Quick Start
Installation
The latest stable version can be installed using pip with:
$ pip install yt_xarray
This will install both xarray and yt if you are missing one or the other.
Usage
The main access point is the YtAccessor object for xarray. To
use it, simply import yt_xarray and the .yt object will be available to
xarray datasets. For example, to convert the xarray dataset into a full-fledged
yt dataset:
import xarray as xr
import yt_xarray
ds = xr.open_dataset(...)
yt_ds = ds.yt.load_grid()
In this example, ds.yt.grid() returns a yt dataset using all of the fields in
the xarray dataset, ready to use with any yt command. This will, however, only
work if all of your data is defined on the same grid using coordinate names that
yt understands. So for more complex cases, see the example notebooks
and the FAQ on how
to handle those cases.
Examples
Check out the example notebooks and the FAQ for examples and descriptions of common issues.
Getting Help
Bug reports and questions are welcome via github issues. You can also reach out via the yt slack channel (see here for how to join) by messaging Chris Havlin directly or posting in help (though you should tag @Chris Havlin in your post to get a faster response.)
Contributions
Contributions are welcome, see CONTRIBUTING.md for details.
Metadata
Release files for yt-xarray 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| yt_xarray-0.5.0.tar.gz | 6.3 MB | With provenance | Details for yt_xarray-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| yt_xarray-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for yt_xarray-0.5.0-py3-none-any.whl |
Total release size: 6.3 MB
Release files / yt_xarray-0.5.0.tar.gz
| Download URL | yt_xarray-0.5.0.tar.gz |
|---|---|
| Size | 6.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
952cc108da68a4a65395b36e976db4a66fd96892e74be4f84fde93c9f7d8b122
|
|
BLAKE2b-256 checksum How to use checksums |
a4563a26a7208feb5c71052c0f8d4f50c7e548a8a91dbe056881f3c12b36a420
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 23, 2026.
Transparency logRelease files / yt_xarray-0.5.0-py3-none-any.whl
| Download URL | yt_xarray-0.5.0-py3-none-any.whl |
|---|---|
| Size | 61.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
68fac9fe08ea43973eea21e2fed131bbd3878842dc5dc08ad406106507ffc5ab
|
|
BLAKE2b-256 checksum How to use checksums |
af2fd0168f7c8b5b3a010af4292006cb813eac48a5110d79daf82cdafcf63051
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 23, 2026.
Transparency logSecurity for yt-xarray 0.5.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for yt_xarray-0.5.0.tar.gz
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 Oct 23, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.