Skip to main content

interface between yt and xarray

Project description

yt_xarray

PyPI version

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

Uploaded Source

Built Distribution

yt_xarray-0.1.3-py2.py3-none-any.whl (18.3 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

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

File hashes

Hashes for yt_xarray-0.1.3.tar.gz
Algorithm Hash digest
SHA256 223af4d25bdfa7451956ceb63116873b2ad45d71df217f553149ead2f8a627c6
MD5 3db994a7832cfad444cb13652b9ee26c
BLAKE2b-256 c479158735b4b92798a83f48c78cff650243299285906b44112b7328159fa94f

See more details on using hashes here.

File details

Details for the file yt_xarray-0.1.3-py2.py3-none-any.whl.

File metadata

  • Download URL: yt_xarray-0.1.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for yt_xarray-0.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 03a6405ce9e19a1b501441d53f6f91145f7433aa51666a97398e60107f200dba
MD5 5cc1a57f2ac4b3d9c3a350bf54c41286
BLAKE2b-256 90b9c08d388e940f89af89620bea527f5291620d4abb6e396513cf62b7743443

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