MCPcopy
hub / github.com/pydata/xarray / test_update

Method test_update

xarray/tests/test_dataset.py:4436–4452  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4434 np.testing.assert_equal(daT.to_numpy(), v1T)
4435
4436 def test_update(self) -> None:
4437 data = create_test_data(seed=0)
4438 expected = data.copy()
4439 var2 = Variable("dim1", np.arange(8))
4440 actual = data
4441 actual.update({"var2": var2})
4442 expected["var2"] = var2
4443 assert_identical(expected, actual)
4444
4445 actual = data.copy()
4446 actual.update(data)
4447 assert_identical(expected, actual)
4448
4449 other = Dataset(attrs={"new": "attr"})
4450 actual = data.copy()
4451 actual.update(other)
4452 assert_identical(expected, actual)
4453
4454 def test_update_overwrite_coords(self) -> None:
4455 data = Dataset({"a": ("x", [1, 2])}, {"b": 3})

Callers

nothing calls this directly

Calls 7

create_test_dataFunction · 0.90
VariableClass · 0.90
assert_identicalFunction · 0.90
DatasetClass · 0.90
arangeMethod · 0.80
copyMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected