Skip to main content

interface between yt and xarray

Project description

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.

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

yt_xarray-0.4.0.tar.gz (6.0 MB view details)

Uploaded Source

Built Distribution

yt_xarray-0.4.0-py3-none-any.whl (46.7 kB view details)

Uploaded Python 3

File details

Details for the file yt_xarray-0.4.0.tar.gz.

File metadata

  • Download URL: yt_xarray-0.4.0.tar.gz
  • Upload date:
  • Size: 6.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.15

File hashes

Hashes for yt_xarray-0.4.0.tar.gz
Algorithm Hash digest
SHA256 d7e8a91295994c2fdef4bdb7941dd04fa45256002484bf9d7c7c88203d2699ce
MD5 3862c712b4b9769f665120c549f9de44
BLAKE2b-256 579247c1e6e264413b7158740f1aa1cf6b9b2d0464b62ca2dd32936ff73f0bbe

See more details on using hashes here.

File details

Details for the file yt_xarray-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: yt_xarray-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 46.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.15

File hashes

Hashes for yt_xarray-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b64267d9b3975d319e5ffc773d77ad7cbb6b808b50ee6aceba23bf870339a480
MD5 f70d57df5933edf49bb35721430658a7
BLAKE2b-256 2247ff88235a55219b6b9917ca1781e1d5a991a8143545b8731b3c6d52fca31b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page