Skip to main content

yt_xarray

PyPI version Python Version Tests pre-commit.ci status

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.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yt-xarray 0.4.1
File Size Uploaded
yt_xarray-0.4.1.tar.gz 6.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for yt-xarray 0.4.1
File Interpreter ABI Platform
yt_xarray-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 6.0 MB

Release files / yt_xarray-0.4.1.tar.gz

Download URL yt_xarray-0.4.1.tar.gz
Size 6.0 MB
Tags Source
SHA-256 checksum
How to use checksums
6f32446245d46360b59491ef571ff6762513ad4bb512bd425d7027af9c43e2e5
BLAKE2b-256 checksum
How to use checksums
a91485af3b85b95eff19de31ab6ffc903ed48e151a96aaa11d95bc1c807a572d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.17

Release files / yt_xarray-0.4.1-py3-none-any.whl

Download URL yt_xarray-0.4.1-py3-none-any.whl
Size 48.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4e4095017f4b2217eed938bcb0844ddf87cf1f512f2ba24cfeeebbaa222b0550
BLAKE2b-256 checksum
How to use checksums
4b061ea3744f2e43b879058557b0b89021454eabf035437f70ed6b173eb9c78b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.17

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page