本文整理汇总了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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)))
示例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'))
示例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'))
示例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)
示例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)