本文整理汇总了Python中iris._data_manager.DataManager._assert_axioms方法的典型用法代码示例。如果您正苦于以下问题:Python DataManager._assert_axioms方法的具体用法?Python DataManager._assert_axioms怎么用?Python DataManager._assert_axioms使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iris._data_manager.DataManager
的用法示例。
在下文中一共展示了DataManager._assert_axioms方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Test__assert_axioms
# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import _assert_axioms [as 别名]
class Test__assert_axioms(tests.IrisTest):
def setUp(self):
self.real_array = np.array(0)
self.lazy_array = as_lazy_data(self.real_array)
self.dm = DataManager(self.real_array)
def test_array_none(self):
self.dm._real_array = None
emsg = 'Unexpected data state, got no lazy and no real data'
with self.assertRaisesRegexp(AssertionError, emsg):
self.dm._assert_axioms()
def test_array_all(self):
self.dm._lazy_array = self.lazy_array
emsg = 'Unexpected data state, got lazy and real data'
with self.assertRaisesRegexp(AssertionError, emsg):
self.dm._assert_axioms()
示例2: Test__assert_axioms
# 需要导入模块: from iris._data_manager import DataManager [as 别名]
# 或者: from iris._data_manager.DataManager import _assert_axioms [as 别名]
class Test__assert_axioms(tests.IrisTest):
def setUp(self):
self.real_array = np.array(0)
self.lazy_array = as_lazy_data(self.real_array)
self.dm = DataManager(self.real_array)
def test_array_none(self):
self.dm._real_array = None
emsg = 'Unexpected data state, got no lazy and no real data'
with self.assertRaisesRegexp(AssertionError, emsg):
self.dm._assert_axioms()
def test_array_all(self):
self.dm._lazy_array = self.lazy_array
emsg = 'Unexpected data state, got lazy and real data'
with self.assertRaisesRegexp(AssertionError, emsg):
self.dm._assert_axioms()
def test_realised_dtype(self):
self.dm._realised_dtype = np.dtype('float')
emsg = 'Unexpected realised dtype state, got dtype'
with self.assertRaisesRegexp(AssertionError, emsg):
self.dm._assert_axioms()
def test_real_array_with_realised_dtype(self):
self.dm._realised_dtype = np.dtype('int')
emsg = ("Unexpected real data with realised dtype, got "
"real data and realised dtype\('int64'\)")
with self.assertRaisesRegexp(AssertionError, emsg):
self.dm._assert_axioms()
def test_non_float_lazy_array_with_realised_dtype(self):
self.dm._real_array = None
self.dm._lazy_array = self.lazy_array
self.dm._realised_dtype = np.dtype('int')
emsg = ("Unexpected lazy data dtype with realised dtype, got "
"lazy data dtype\('int64'\) and realised "
"dtype\('int64'\)")
with self.assertRaisesRegexp(AssertionError, emsg):
self.dm._assert_axioms()