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

Function test_h5netcdf_entrypoint

xarray/tests/test_backends.py:7511–7530  ·  view source on GitHub ↗
(tmp_path: Path)

Source from the content-addressed store, hash-verified

7509
7510@requires_h5netcdf
7511def test_h5netcdf_entrypoint(tmp_path: Path) -> None:
7512 entrypoint = H5netcdfBackendEntrypoint()
7513 ds = create_test_data()
7514
7515 path = tmp_path / "foo"
7516 ds.to_netcdf(path, engine="h5netcdf")
7517 _check_guess_can_open_and_open(entrypoint, path, engine="h5netcdf", expected=ds)
7518 _check_guess_can_open_and_open(
7519 entrypoint, str(path), engine="h5netcdf", expected=ds
7520 )
7521 with open(path, "rb") as f:
7522 _check_guess_can_open_and_open(entrypoint, f, engine="h5netcdf", expected=ds)
7523
7524 contents = ds.to_netcdf(engine="h5netcdf")
7525 _check_guess_can_open_and_open(entrypoint, contents, engine="h5netcdf", expected=ds)
7526
7527 assert entrypoint.guess_can_open("something-local.nc")
7528 assert entrypoint.guess_can_open("something-local.nc4")
7529 assert entrypoint.guess_can_open("something-local.cdf")
7530 assert not entrypoint.guess_can_open("not-found-and-no-extension")
7531
7532
7533@requires_zarr

Callers

nothing calls this directly

Calls 5

guess_can_openMethod · 0.95
create_test_dataFunction · 0.85
to_netcdfMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…