Skip to main content

interface between yt and xarray

Project description

yt_xarray

PyPI version 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.2.0.tar.gz (3.8 MB view details)

Uploaded Source

Built Distribution

yt_xarray-0.2.0-py3-none-any.whl (27.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: yt_xarray-0.2.0.tar.gz
  • Upload date:
  • Size: 3.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for yt_xarray-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3d8ef67d43665011741cca9aa23eb086a01d54dfbd4bf7863f809571b7441e9a
MD5 c8aef5416eccc7fd696ae8a4a2fe6575
BLAKE2b-256 f1ed7526fe29ad6cc94e116891bccde150d3cfdd7b7101451182513a2665d461

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yt_xarray-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 27.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for yt_xarray-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bd846f18d699c669015c0db4ab4967b60795cc33b4acc44c2f11b368c396ecf5
MD5 64d0c1c170e549ab00052403239bf2e4
BLAKE2b-256 dd7a9bb751f7e28331fb93195a12da681dc8a8a9399fc1b9c8fd34b0f4b56a07

See more details on using hashes here.

Supported by

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