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

Method create_datasets

xarray/tests/test_backends.py:6583–6591  ·  view source on GitHub ↗
(self, **kwargs)

Source from the content-addressed store, hash-verified

6581
6582 @contextlib.contextmanager
6583 def create_datasets(self, **kwargs):
6584 with open_example_dataset("bears.nc") as expected:
6585 # print("QQ0:", expected["bears"].load())
6586 pydap_ds = self.convert_to_pydap_dataset(expected)
6587 actual = open_dataset(PydapDataStore(pydap_ds))
6588 # netcdf converts string to byte not unicode
6589 # fixed in pydap 3.5.6. https://github.com/pydap/pydap/issues/510
6590 actual["bears"].values = actual["bears"].values.astype("S")
6591 yield actual, expected
6592
6593 def test_cmp_local_file(self) -> None:
6594 with self.create_datasets() as (actual, expected):

Callers 3

test_cmp_local_fileMethod · 0.95
test_daskMethod · 0.95

Calls 5

open_datasetFunction · 0.90
PydapDataStoreClass · 0.90
open_example_datasetFunction · 0.85
astypeMethod · 0.45

Tested by

no test coverage detected