Skip to content
forked from pydata/xarray

Commit 0d1825e

Browse files
committed
rename var names.
1 parent 4eefd25 commit 0d1825e

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

xarray/tests/test_concat.py

+18-18
Original file line numberDiff line numberDiff line change
@@ -291,18 +291,18 @@ class TestConcatDatasetNewApi:
291291
def setUp(self):
292292
self.ds1 = Dataset(
293293
{
294-
"has_x_y": (("y", "x"), [[1, 2]]),
295-
"has_x": ("x", [1, 2]),
296-
"no_x_y": ("z", [1, 2]),
294+
"only_x_y": (("y", "x"), [[1, 2]]),
295+
"only_x": ("x", [1, 2]),
296+
"only_z": ("z", [1, 2]),
297297
"const1": 1.0,
298298
},
299299
coords={"x": [0, 1], "y": [0], "z": [-1, -2], "coord1": ("x", [0, 1])},
300300
)
301301
self.ds2 = Dataset(
302302
{
303-
"has_x_y": (("y", "x"), [[3, 4]]),
304-
"has_x": ("x", [1.1, 2.1]),
305-
"no_x_y": ("z", [1, 2]),
303+
"only_x_y": (("y", "x"), [[3, 4]]),
304+
"only_x": ("x", [1.1, 2.1]),
305+
"only_z": ("z", [1, 2]),
306306
"const1": 1.0,
307307
},
308308
coords={
@@ -315,22 +315,22 @@ def setUp(self):
315315

316316
self.expected_y = Dataset(
317317
{
318-
"has_x_y": (("y", "x"), [[1, 2], [3, 4]]),
319-
"has_x": ("x", [1, 2]),
320-
"no_x_y": ("z", [1, 2]),
318+
"only_x_y": (("y", "x"), [[1, 2], [3, 4]]),
319+
"only_x": ("x", [1, 2]),
320+
"only_z": ("z", [1, 2]),
321321
"const1": 1.0,
322322
},
323323
coords={"x": [0, 1], "y": [0, 1], "z": [-1, -2], "coord1": ("x", [0, 1])},
324324
)
325325

326326
self.expected_new_dim = Dataset(
327327
{
328-
"has_x_y": (
328+
"only_x_y": (
329329
("new_dim", "y", "x"),
330330
[[[1, 2], [np.nan, np.nan]], [[np.nan, np.nan], [3, 4]]],
331331
),
332-
"has_x": (("new_dim", "x"), [[1, 2], [1.1, 2.1]]),
333-
"no_x_y": (("new_dim", "z"), [[1, 2], [1, 2]]),
332+
"only_x": (("new_dim", "x"), [[1, 2], [1.1, 2.1]]),
333+
"only_z": (("new_dim", "z"), [[1, 2], [1, 2]]),
334334
"const1": ("new_dim", [1.0, 1.0]),
335335
},
336336
coords={
@@ -345,7 +345,7 @@ def setUp(self):
345345

346346
def test_concat_sensible_compat_errors(self):
347347

348-
with raises_regex(ValueError, "'has_x' is not equal across datasets."):
348+
with raises_regex(ValueError, "'only_x' is not equal across datasets."):
349349
concat(self.dsets, data_vars="sensible", dim="y")
350350

351351
with raises_regex(ValueError, "'coord1' is not equal across datasets."):
@@ -378,15 +378,15 @@ def test_compat_override(self, data_vars, coords):
378378
)
379379

380380
if data_vars == "all":
381-
expected_y_dim = ["has_x_y", "has_x", "no_x_y", "const1"]
381+
expected_y_dim = ["only_x_y", "only_x", "only_z", "const1"]
382382
equal_to_first_ds = []
383383
elif data_vars == "sensible":
384-
expected_y_dim = ["has_x_y"]
384+
expected_y_dim = ["only_x_y"]
385385
if coords == "all":
386-
# in this case, variable has_x will not have coord1 as non-dim coord
387-
equal_to_first_ds = ["no_x_y", "const1"]
386+
# in this case, variable only_x will not have coord1 as non-dim coord
387+
equal_to_first_ds = ["only_z", "const1"]
388388
if coords == "sensible":
389-
equal_to_first_ds = ["has_x", "no_x_y", "const1"]
389+
equal_to_first_ds = ["only_x", "only_z", "const1"]
390390

391391
if coords == "all":
392392
expected_y_dim += ["coord1"]

0 commit comments

Comments
 (0)