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


Python DataManager.has_lazy_data方法代码示例

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


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

示例1: test_zero_ndim_lazy_with_zero_ndim_real

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import has_lazy_data [as 别名]
 def test_zero_ndim_lazy_with_zero_ndim_real(self):
     real_array = np.array(456)
     dm = DataManager(as_lazy_data(np.array(123)))
     self.assertTrue(dm.has_lazy_data())
     dm.data = real_array
     self.assertFalse(dm.has_lazy_data())
     self.assertArrayEqual(dm.data, real_array)
开发者ID:cpelley,项目名称:iris,代码行数:9,代码来源:test_DataManager.py

示例2: test_zero_ndim_lazy_to_scalar_1d_real_promote

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import has_lazy_data [as 别名]
 def test_zero_ndim_lazy_to_scalar_1d_real_promote(self):
     real_array = np.array([456])
     dm = DataManager(as_lazy_data(np.array(123)))
     self.assertTrue(dm.has_lazy_data())
     dm.data = real_array
     self.assertFalse(dm.has_lazy_data())
     self.assertArrayEqual(dm.data, real_array)
开发者ID:cpelley,项目名称:iris,代码行数:9,代码来源:test_DataManager.py

示例3: test_zero_ndim_lazy_with_zero_ndim_lazy

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import has_lazy_data [as 别名]
 def test_zero_ndim_lazy_with_zero_ndim_lazy(self):
     lazy_array = as_lazy_data(np.array(456))
     dm = DataManager(as_lazy_data(np.array(123)))
     self.assertTrue(dm.has_lazy_data())
     dm.data = lazy_array
     self.assertTrue(dm.has_lazy_data())
     self.assertArrayEqual(dm.data, lazy_array.compute())
开发者ID:cpelley,项目名称:iris,代码行数:9,代码来源:test_DataManager.py

示例4: test_real_with_real

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

示例5: test_zero_ndim_lazy_to_scalar_1d_lazy_promote

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import has_lazy_data [as 别名]
 def test_zero_ndim_lazy_to_scalar_1d_lazy_promote(self):
     lazy_array = as_lazy_data(np.array([456]))
     dm = DataManager(as_lazy_data(np.array(123)))
     self.assertTrue(dm.has_lazy_data())
     dm.data = lazy_array
     self.assertTrue(dm.has_lazy_data())
     self.assertArrayEqual(dm.data, lazy_array.compute())
开发者ID:cpelley,项目名称:iris,代码行数:9,代码来源:test_DataManager.py

示例6: test_with_real_array

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

示例7: test_zero_ndim_real_with_scalar_float

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import has_lazy_data [as 别名]
 def test_zero_ndim_real_with_scalar_float(self):
     value = 456.0
     dm = DataManager(np.array(123))
     self.assertFalse(dm.has_lazy_data())
     dm.data = value
     self.assertFalse(dm.has_lazy_data())
     self.assertArrayEqual(dm.data, np.array(value))
开发者ID:cpelley,项目名称:iris,代码行数:9,代码来源:test_DataManager.py

示例8: test_lazy_with_lazy

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

示例9: test_nd_real_to_nd_real

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import has_lazy_data [as 别名]
 def test_nd_real_to_nd_real(self):
     shape = (2, 3, 4)
     size = np.prod(shape)
     real_array = np.arange(size).reshape(shape)
     dm = DataManager(real_array * 10)
     self.assertFalse(dm.has_lazy_data())
     dm.data = real_array
     self.assertFalse(dm.has_lazy_data())
     self.assertArrayEqual(dm.data, real_array)
开发者ID:cpelley,项目名称:iris,代码行数:11,代码来源:test_DataManager.py

示例10: test_with_lazy_mask_array__masked

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import has_lazy_data [as 别名]
 def test_with_lazy_mask_array__masked(self):
     dm = DataManager(self.lazy_mask_array_masked)
     self.assertTrue(dm.has_lazy_data())
     result = dm.data
     self.assertFalse(dm.has_lazy_data())
     self.assertIsInstance(result, ma.MaskedArray)
     self.assertEqual(dm.dtype, self.dtype)
     self.assertEqual(result.fill_value, self.fill_value)
     self.assertArrayEqual(result, self.mask_array_masked)
开发者ID:dennissergeev,项目名称:iris,代码行数:11,代码来源:test_DataManager.py

示例11: test_nd_lazy_to_nd_lazy

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import has_lazy_data [as 别名]
 def test_nd_lazy_to_nd_lazy(self):
     shape = (2, 3, 4)
     size = np.prod(shape)
     real_array = np.arange(size).reshape(shape)
     lazy_array = as_lazy_data(real_array)
     dm = DataManager(lazy_array * 10)
     self.assertTrue(dm.has_lazy_data())
     dm.data = lazy_array
     self.assertTrue(dm.has_lazy_data())
     self.assertArrayEqual(dm.data, lazy_array.compute())
开发者ID:cpelley,项目名称:iris,代码行数:12,代码来源:test_DataManager.py

示例12: test_with_lazy_mask_array__masked

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import has_lazy_data [as 别名]
 def test_with_lazy_mask_array__masked(self):
     dm = DataManager(self.lazy_mask_array_masked,
                      realised_dtype=self.realised_dtype)
     self.assertTrue(dm.has_lazy_data())
     result = dm.data
     self.assertFalse(dm.has_lazy_data())
     self.assertIsInstance(result, ma.MaskedArray)
     self.assertIsNone(dm._realised_dtype)
     self.assertEqual(dm.dtype, self.realised_dtype)
     self.assertArrayEqual(result, self.lazy_mask_array_masked.compute())
开发者ID:cpelley,项目名称:iris,代码行数:12,代码来源:test_DataManager.py

示例13: test_lazy_with_real__realised_dtype_none

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import has_lazy_data [as 别名]
 def test_lazy_with_real__realised_dtype_none(self):
     mask_array = ma.arange(self.size).reshape(self.shape)
     dtype = mask_array.dtype
     lazy_array = as_lazy_data(mask_array)
     dm = DataManager(lazy_array, realised_dtype=dtype)
     self.assertTrue(dm.has_lazy_data())
     self.assertIsNone(dm._realised_dtype, dtype)
     self.assertEqual(dm.dtype, dtype)
     dm.replace(mask_array)
     self.assertFalse(dm.has_lazy_data())
     self.assertIsNone(dm._realised_dtype)
     self.assertEqual(dm.dtype, dtype)
     self.assertIs(dm._real_array, mask_array)
     self.assertIs(dm.data, mask_array)
开发者ID:cpelley,项目名称:iris,代码行数:16,代码来源:test_DataManager.py

示例14: test_real_with_lazy__realised_dtype_setter_none

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import has_lazy_data [as 别名]
 def test_real_with_lazy__realised_dtype_setter_none(self):
     mask_array = ma.masked_array(self.real_array) * 10
     dtype = mask_array.dtype
     lazy_array = as_lazy_data(mask_array)
     dm = DataManager(self.real_array)
     self.assertFalse(dm.has_lazy_data())
     self.assertIsNone(dm._realised_dtype)
     self.assertEqual(dm.dtype, dtype)
     dm.replace(lazy_array, realised_dtype=dtype)
     self.assertTrue(dm.has_lazy_data())
     self.assertIsNone(dm._realised_dtype)
     self.assertEqual(dm.dtype, dtype)
     self.assertIs(dm._lazy_array, lazy_array)
     self.assertArrayEqual(dm.data, mask_array)
开发者ID:cpelley,项目名称:iris,代码行数:16,代码来源:test_DataManager.py

示例15: test_with_real_masked_constant

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import has_lazy_data [as 别名]
 def test_with_real_masked_constant(self):
     masked_data = ma.masked_array([666], mask=True, dtype=np.dtype('f8'))
     masked_constant = masked_data[0]
     dm = DataManager(masked_constant)
     result = dm.data
     self.assertFalse(dm.has_lazy_data())
     self.assertIsInstance(result, ma.MaskedArray)
     self.assertNotIsInstance(result, ma.core.MaskedConstant)
     self.assertMaskedArrayEqual(result, masked_data)
开发者ID:cpelley,项目名称:iris,代码行数:11,代码来源:test_DataManager.py


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