test_data.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:psyplot 作者: Chilipp 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号