Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion xbout/calc/turbulence.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import numpy as np
import xarray as xr


# TODO write a decorator to add functions as accessors to dataarrays?


Expand Down
1 change: 0 additions & 1 deletion xbout/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import pytest


configure_is_imported = False


Expand Down
8 changes: 2 additions & 6 deletions xbout/geometries.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,9 @@ def apply_geometry(ds, geometry_name, *, coordinates=None, grid=None):
try:
add_geometry_coords = REGISTERED_GEOMETRIES[geometry_name]
except KeyError:
message = dedent(
"""{} is not a registered geometry. Inspect the global
message = dedent("""{} is not a registered geometry. Inspect the global
variable REGISTERED_GEOMETRIES to see which geometries
have been registered.""".format(
geometry_name
)
)
have been registered.""".format(geometry_name))
raise UnregisteredGeometryError(message)

# User-registered functions may accept 'coordinates' and 'grid' arguments, but
Expand Down
1 change: 0 additions & 1 deletion xbout/plotting/animate.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
)
from matplotlib.animation import PillowWriter


if (
"pcolor.shading" in matplotlib.rcParams
and matplotlib.rcParams["pcolor.shading"] == "flat"
Expand Down
1 change: 0 additions & 1 deletion xbout/plotting/plotfuncs.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
plot_targets,
)


if (
"pcolor.shading" in matplotlib.rcParams
and matplotlib.rcParams["pcolor.shading"] == "flat"
Expand Down
1 change: 0 additions & 1 deletion xbout/tests/test_boutdataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from xbout.utils import _set_attrs_on_all_vars, _1d_coord_from_spacing
from xbout.tests.utils_for_tests import set_geometry_from_input_file


EXAMPLE_OPTIONS_FILE_PATH = "./xbout/tests/data/options/BOUT.inp"


Expand Down
1 change: 0 additions & 1 deletion xbout/tests/test_region.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from xbout import open_boutdataset


params_guards = "guards"
params_guards_values = [
pytest.param({"x": 0, "y": 0}, marks=pytest.mark.long),
Expand Down
1 change: 0 additions & 1 deletion xbout/tests/utils_for_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from pathlib import Path
from xarray import DataArray, Dataset


# Note, MYPE, PE_XIND and PE_YIND not included, since they are different for each
# processor and so are dropped when loading datasets.
METADATA_VARS = [
Expand Down
6 changes: 5 additions & 1 deletion xbout/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,11 @@ def _pad_y_boundaries(ds):
ycoord = ds.metadata.get("bout_ydim", "y")
has_second_divertor = ds.metadata["jyseps2_1"] != ds.metadata["jyseps1_2"]

if not ds.metadata["keep_yboundaries"] and myg > 0:
if (
not ds.metadata["keep_yboundaries"]
and myg > 0
and ds.metadata["ny"] == ds.dims["y"]
):
boundary_pad = ds.isel({ycoord: slice(myg)}).copy(deep=True).load()
for v in boundary_pad:
if ycoord in boundary_pad[v].dims:
Expand Down