Skip to content

Commit

Permalink
Merge pull request #194 from boutproject/fix-ddy-regions
Browse files Browse the repository at this point in the history
Fix regions in result of ddy()
  • Loading branch information
johnomotani authored Apr 22, 2021
2 parents 7268c6f + 7f29c62 commit 8f14cb2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions xbout/boutdataarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import xarray as xr
from xarray import register_dataarray_accessor

from .geometries import apply_geometry
from .plotting.animate import animate_poloidal, animate_pcolormesh, animate_line
from .plotting import plotfuncs
from .plotting.utils import _create_norm
Expand Down Expand Up @@ -293,6 +294,7 @@ def interpolate_parallel(
return result
else:
# Extract the DataArray to return
result = apply_geometry(result, self.data.geometry)
return result[self.data.name]

# Select a particular 'region' and interpolate to higher parallel resolution
Expand Down Expand Up @@ -532,6 +534,9 @@ def ddy(self, region=None):
name = self.data.name
result = xr.combine_by_coords(parts)[f"d({name})/dy"]

# regions get mixed up during the split and combine_by_coords, so reset them
result.attrs["regions"] = self.data.regions

return result

da = self.data
Expand Down

0 comments on commit 8f14cb2

Please sign in to comment.