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

Function test_get_loc

xarray/tests/test_cftimeindex.py:435–446  ·  view source on GitHub ↗
(date_type, index)

Source from the content-addressed store, hash-verified

433
434@requires_cftime
435def test_get_loc(date_type, index):
436 result = index.get_loc("0001")
437 assert result == slice(0, 2)
438
439 result = index.get_loc(date_type(1, 2, 1))
440 assert result == 1
441
442 result = index.get_loc("0001-02-01")
443 assert result == slice(1, 2)
444
445 with pytest.raises(KeyError, match=r"1234"):
446 index.get_loc("1234")
447
448
449@requires_cftime

Callers

nothing calls this directly

Calls 2

date_typeFunction · 0.85
get_locMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…