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

Uploaded Source

Built Distribution

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

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: yt_xarray-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 d439eb9583c8b37c0e010249ca4045dcea3e16d6875c575a5f8ca65c27f85289
MD5 882435ddff0ec5f624008bffafb25d87
BLAKE2b-256 6d5659cfd09771e51a7f810bdd56ec5dbc760a86d8edd20f179eba15d5aed1d8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yt_xarray-0.1.4-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.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b6bc5ea69d23999613dca5eeb2713439367646913f5910461bb2f90effe8890d
MD5 f2585ed88f927959a5741ed729bb6f42
BLAKE2b-256 56a4d6f6bc815c541d0780da46766518b39bfc98365024bbce0b11523c3b07b2

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