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


Python DataManager.data方法代码示例

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


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

示例1: test_mask_array__with_fill_value

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

示例2: test_lazy_array__fill_value_clearance

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

示例3: test_zero_ndim_lazy_to_scalar_1d_lazy_promote

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import 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

示例4: test_zero_ndim_lazy_to_scalar_1d_real_promote

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import 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

示例5: test_zero_ndim_lazy_with_zero_ndim_lazy

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import 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

示例6: test_zero_ndim_lazy_with_zero_ndim_real

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import 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

示例7: test_zero_ndim_real_with_scalar_float

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import 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_nd_real_to_nd_real

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import 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

示例9: test_coerce_to_ndarray

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import data [as 别名]
 def test_coerce_to_ndarray(self):
     shape = (2, 3)
     size = np.prod(shape)
     real_array = np.arange(size).reshape(shape)
     matrix = np.matrix(real_array)
     dm = DataManager(real_array)
     dm.data = matrix
     self.assertIsInstance(dm._real_array, np.core.ndarray)
     self.assertIsInstance(dm.data, np.core.ndarray)
     self.assertArrayEqual(dm.data, real_array)
开发者ID:cpelley,项目名称:iris,代码行数:12,代码来源:test_DataManager.py

示例10: test_nd_lazy_to_nd_lazy

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import 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

示例11: test_realised_dtype_none

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

示例12: test_mask_array__default_fill_value

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

示例13: test_real_array__fill_value_clearance

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

示例14: test_scalar_1d_to_zero_ndim_fail

# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import data [as 别名]
 def test_scalar_1d_to_zero_ndim_fail(self):
     dm = DataManager(np.array([123]))
     emsg = 'Require data with shape \(1,\), got \(\).'
     with self.assertRaisesRegexp(ValueError, emsg):
         dm.data = 456
开发者ID:cpelley,项目名称:iris,代码行数:7,代码来源:test_DataManager.py


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