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

Function test_eval_coordinate_priority

xarray/tests/test_eval.py:307–317  ·  view source on GitHub ↗

Test that coordinates also take priority over builtins.

()

Source from the content-addressed store, hash-verified

305
306
307def test_eval_coordinate_priority() -> None:
308 """Test that coordinates also take priority over builtins."""
309 ds = Dataset(
310 {"data": ("x", [1.0, 2.0, 3.0])},
311 coords={"sum": ("x", [10.0, 20.0, 30.0])}, # coordinate named 'sum'
312 )
313
314 # Coordinate should be accessible and take priority over builtin
315 result = ds.eval("data + sum")
316 expected = ds["data"] + ds.coords["sum"]
317 assert_equal(result, expected)
318
319
320# Error message tests

Callers

nothing calls this directly

Calls 3

evalMethod · 0.95
DatasetClass · 0.90
assert_equalFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…