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

Method create_dap2_datasets

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

Source from the content-addressed store, hash-verified

6645class TestPydapOnline(TestPydap):
6646 @contextlib.contextmanager
6647 def create_dap2_datasets(self, **kwargs):
6648 # in pydap 3.5.0, urls defaults to dap2.
6649 url = "http://test.opendap.org/opendap/data/nc/bears.nc"
6650 actual = open_dataset(url, engine="pydap", **kwargs)
6651 # pydap <3.5.6 converts to unicode dtype=|U. Not what
6652 # xarray expects. Thus force to bytes dtype. pydap >=3.5.6
6653 # does not convert to unicode. https://github.com/pydap/pydap/issues/510
6654 actual["bears"].values = actual["bears"].values.astype("S")
6655 with open_example_dataset("bears.nc") as expected:
6656 yield actual, expected
6657
6658 def output_grid_deprecation_warning_dap2dataset(self):
6659 with pytest.warns(FutureWarning, match="`output_grid` is deprecated"):

Calls 3

open_datasetFunction · 0.90
open_example_datasetFunction · 0.85
astypeMethod · 0.45

Tested by

no test coverage detected