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

Function test_custom_engine

xarray/tests/test_backends_api.py:118–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

116
117
118def test_custom_engine() -> None:
119 expected = xr.Dataset(
120 dict(a=2 * np.arange(5)), coords=dict(x=("x", np.arange(5), dict(units="s")))
121 )
122
123 class CustomBackend(xr.backends.BackendEntrypoint):
124 def open_dataset(
125 self,
126 filename_or_obj,
127 drop_variables=None,
128 **kwargs,
129 ) -> xr.Dataset:
130 return expected.copy(deep=True)
131
132 actual = xr.open_dataset("fake_filename", engine=CustomBackend)
133 assert_identical(expected, actual)
134
135
136def test_multiindex() -> None:

Callers

nothing calls this directly

Calls 3

assert_identicalFunction · 0.90
arangeMethod · 0.80
open_datasetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…