MCPcopy Index your code
hub / github.com/pydata/xarray / test_starts_ends_with

Function test_starts_ends_with

xarray/tests/test_accessor_str.py:214–225  ·  view source on GitHub ↗
(dtype)

Source from the content-addressed store, hash-verified

212
213
214def test_starts_ends_with(dtype) -> None:
215 values = xr.DataArray(["om", "foo_nom", "nom", "bar_foo", "foo"]).astype(dtype)
216
217 result = values.str.startswith("foo")
218 expected = xr.DataArray([False, True, False, False, True])
219 assert result.dtype == expected.dtype
220 assert_equal(result, expected)
221
222 result = values.str.endswith("foo")
223 expected = xr.DataArray([False, False, False, True, True])
224 assert result.dtype == expected.dtype
225 assert_equal(result, expected)
226
227
228def test_starts_ends_with_broadcast(dtype) -> None:

Callers

nothing calls this directly

Calls 4

assert_equalFunction · 0.90
startswithMethod · 0.80
endswithMethod · 0.80
astypeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…