当前位置: 首页>>代码示例>>Python>>正文


Python DataManager._deepcopy方法代码示例

本文整理汇总了Python中iris._data_manager.DataManager._deepcopy方法的典型用法代码示例。如果您正苦于以下问题:Python DataManager._deepcopy方法的具体用法?Python DataManager._deepcopy怎么用?Python DataManager._deepcopy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在iris._data_manager.DataManager的用法示例。


在下文中一共展示了DataManager._deepcopy方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_lazy_with_lazy

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import _deepcopy [as 别名]
 def test_lazy_with_lazy(self):
     dm = DataManager(as_lazy_data(self.real_array))
     data = as_lazy_data(self.real_array) * 10
     result = dm._deepcopy(self.memo, data=data)
     expected = DataManager(data)
     self.assertEqual(result, expected)
     self.assertIs(result._lazy_array, data)
开发者ID:cpelley,项目名称:iris,代码行数:9,代码来源:test_DataManager.py

示例2: test_real_with_real

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import _deepcopy [as 别名]
 def test_real_with_real(self):
     dm = DataManager(self.real_array)
     data = self.real_array.copy() * 10
     result = dm._deepcopy(self.memo, data=data)
     expected = DataManager(data)
     self.assertEqual(result, expected)
     self.assertIs(result._real_array, data)
开发者ID:cpelley,项目名称:iris,代码行数:9,代码来源:test_DataManager.py

示例3: test_lazy_with_realised_dtype

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import _deepcopy [as 别名]
 def test_lazy_with_realised_dtype(self):
     dm = DataManager(as_lazy_data(self.real_array),
                      realised_dtype=np.dtype('int16'))
     data = as_lazy_data(self.real_array) * 10
     dtype = np.dtype('int8')
     result = dm._deepcopy(self.memo, data=data, realised_dtype=dtype)
     expected = DataManager(data, realised_dtype=dtype)
     self.assertEqual(result, expected)
     self.assertIs(result._lazy_array, data)
开发者ID:cpelley,项目名称:iris,代码行数:11,代码来源:test_DataManager.py

示例4: test__set_fill_value_failure

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import _deepcopy [as 别名]
 def test__set_fill_value_failure(self):
     dm = DataManager(np.array(0))
     self.assertIsNone(dm.fill_value)
     emsg = 'Cannot copy'
     with self.assertRaisesRegexp(ValueError, emsg):
         dm._deepcopy(self.memo, fill_value=1e+20)
开发者ID:cpelley,项目名称:iris,代码行数:8,代码来源:test_DataManager.py

示例5: test__set_fill_value

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import _deepcopy [as 别名]
 def test__set_fill_value(self):
     fill_value = 1234
     dm = DataManager(np.array(0))
     self.assertIsNone(dm.fill_value)
     result = dm._deepcopy(self.memo, fill_value=fill_value)
     self.assertEqual(result.fill_value, fill_value)
开发者ID:cpelley,项目名称:iris,代码行数:8,代码来源:test_DataManager.py

示例6: test__default_with_fill_value

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import _deepcopy [as 别名]
 def test__default_with_fill_value(self):
     fill_value = 1234
     dm = DataManager(np.array(0), fill_value=fill_value)
     self.assertEqual(dm.fill_value, fill_value)
     result = dm._deepcopy(self.memo)
     self.assertEqual(result.fill_value, fill_value)
开发者ID:cpelley,项目名称:iris,代码行数:8,代码来源:test_DataManager.py

示例7: test__default_fill_value

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import _deepcopy [as 别名]
 def test__default_fill_value(self):
     dm = DataManager(np.array(0))
     self.assertIsNone(dm.fill_value)
     result = dm._deepcopy(self.memo)
     self.assertIsNone(result.fill_value)
开发者ID:cpelley,项目名称:iris,代码行数:7,代码来源:test_DataManager.py

示例8: test_lazy_with_lazy_failure

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import _deepcopy [as 别名]
 def test_lazy_with_lazy_failure(self):
     dm = DataManager(as_lazy_data(self.real_array))
     emsg = 'Cannot copy'
     with self.assertRaisesRegexp(ValueError, emsg):
         dm._deepcopy(self.memo, data=as_lazy_data(np.array(0)))
开发者ID:cpelley,项目名称:iris,代码行数:7,代码来源:test_DataManager.py

示例9: test_lazy_with_realised_dtype_failure

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import _deepcopy [as 别名]
 def test_lazy_with_realised_dtype_failure(self):
     dm = DataManager(as_lazy_data(self.real_array))
     emsg = 'Cannot copy'
     with self.assertRaisesRegexp(ValueError, emsg):
         dm._deepcopy(self.memo, realised_dtype=np.dtype('float32'))
开发者ID:cpelley,项目名称:iris,代码行数:7,代码来源:test_DataManager.py

示例10: test_real_with_realised_dtype_failure

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import _deepcopy [as 别名]
 def test_real_with_realised_dtype_failure(self):
     dm = DataManager(self.real_array)
     emsg = 'Cannot copy'
     with self.assertRaisesRegexp(ValueError, emsg):
         dm._deepcopy(self.memo, realised_dtype=np.dtype('int16'))
开发者ID:cpelley,项目名称:iris,代码行数:7,代码来源:test_DataManager.py

示例11: test_lazy

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import _deepcopy [as 别名]
 def test_lazy(self):
     dm = DataManager(as_lazy_data(self.real_array))
     result = dm._deepcopy(self.memo)
     self.assertEqual(dm, result)
开发者ID:cpelley,项目名称:iris,代码行数:6,代码来源:test_DataManager.py

示例12: test_real

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import _deepcopy [as 别名]
 def test_real(self):
     dm = DataManager(self.real_array)
     result = dm._deepcopy(self.memo)
     self.assertEqual(dm, result)
开发者ID:cpelley,项目名称:iris,代码行数:6,代码来源:test_DataManager.py


注:本文中的iris._data_manager.DataManager._deepcopy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。