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

Function test_repeat

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

Source from the content-addressed store, hash-verified

1533
1534
1535def test_repeat(dtype) -> None:
1536 values = xr.DataArray(["a", "b", "c", "d"]).astype(dtype)
1537
1538 result = values.str.repeat(3)
1539 result_mul = values.str * 3
1540
1541 expected = xr.DataArray(["aaa", "bbb", "ccc", "ddd"]).astype(dtype)
1542
1543 assert result.dtype == expected.dtype
1544 assert result_mul.dtype == expected.dtype
1545
1546 assert_equal(result_mul, expected)
1547 assert_equal(result, expected)
1548
1549
1550def test_repeat_broadcast(dtype) -> None:

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
repeatMethod · 0.80
astypeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…