def test_from_dataset_02_name(self):
"""Test the from_dataset creation method with selected names"""
variables, coords = self._from_dataset_test_variables
ds = xr.Dataset(variables, coords)
l = self.list_class.from_dataset(ds, name="v2")
self.assertEqual(len(l), 1)
self.assertEqual(set(l.names), {"v2"})
for arr in l:
self.assertEqual(arr.dims, variables[arr.name].dims,
msg="Wrong dimensions for variable " + arr.name)
self.assertEqual(arr.shape, variables[arr.name].shape,
msg="Wrong shape for variable " + arr.name)
评论列表
文章目录