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

Uploaded Source

Built Distribution

yt_xarray-0.4.1-py3-none-any.whl (48.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for yt_xarray-0.4.1.tar.gz
Algorithm Hash digest
SHA256 6f32446245d46360b59491ef571ff6762513ad4bb512bd425d7027af9c43e2e5
MD5 6ce7292c502f8e7efed8b21985193bb4
BLAKE2b-256 a91485af3b85b95eff19de31ab6ffc903ed48e151a96aaa11d95bc1c807a572d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yt_xarray-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 48.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.17

File hashes

Hashes for yt_xarray-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4e4095017f4b2217eed938bcb0844ddf87cf1f512f2ba24cfeeebbaa222b0550
MD5 0e6be5d78547c1af783bb1a011d82b78
BLAKE2b-256 4b061ea3744f2e43b879058557b0b89021454eabf035437f70ed6b173eb9c78b

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