data-exp-lab / yt_xarray

An interface for yt and xarray
MIT License
3 stars 2 forks source link

Adding yt convenience functions #72

Closed chrishavlin closed 10 months ago

chrishavlin commented 1 year ago

Lays groundwork for #35 , adds some of the functions.

Example:

from yt_xarray.sample_data import load_random_xr_data

fields = {'temperature': ('x', 'y', 'z'), 'pressure': ('x', 'y', 'z')}
dims = {'x': (0, 1, 15), 'y': (0, 1, 10), 'z': (0, 1, 15)}
ds = load_random_xr_data(fields, dims, length_unit='m')
p = ds.yt.PhasePlot('temperature', 'pressure', 'temperature')
p.save('phase_test_yt_xarray.png')

phase_test_yt_xarray

codecov[bot] commented 1 year ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (c3d5318) 98.68% compared to head (44035b2) 98.75%. Report is 9 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #72 +/- ## ========================================== + Coverage 98.68% 98.75% +0.06% ========================================== Files 14 15 +1 Lines 1138 1200 +62 ========================================== + Hits 1123 1185 +62 Misses 15 15 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

chrishavlin commented 1 year ago

may still play around with how to organize the methods. Right now everything is under xr_ds.yt.vis., could bump all the methods up to the top of the yt accessor xr_ds.yt.

chrishavlin commented 10 months ago

may still play around with how to organize the methods. Right now everything is under xr_ds.yt.vis., could bump all the methods up to the top of the yt accessor xr_ds.yt.

Decided to bump everything up one level to xr_ds.yt. and remove the nested accessor