本文整理汇总了Python中ert.util.TimeVector.append方法的典型用法代码示例。如果您正苦于以下问题:Python TimeVector.append方法的具体用法?Python TimeVector.append怎么用?Python TimeVector.append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ert.util.TimeVector
的用法示例。
在下文中一共展示了TimeVector.append方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_contains_time
# 需要导入模块: from ert.util import TimeVector [as 别名]
# 或者: from ert.util.TimeVector import append [as 别名]
def test_contains_time(self):
start = datetime.datetime(2010 , 1 , 1 , 0,0,0)
end = datetime.datetime(2010 , 2 , 1 , 0,0,0)
other = datetime.datetime(2010 , 1 , 15 , 0,0,0)
tv = TimeVector()
tv.append( start )
tv.append( end )
self.assertTrue( start in tv )
self.assertTrue( end in tv )
self.assertTrue( other not in tv)
示例2: test_time_vector
# 需要导入模块: from ert.util import TimeVector [as 别名]
# 或者: from ert.util.TimeVector import append [as 别名]
def test_time_vector(self):
time_vector = TimeVector()
time1 = ctime(datetime(2013, 8, 13, 0, 0, 0))
time2 = ctime(datetime(2013, 8, 13, 1, 0, 0))
time_vector.default = time2
time_vector.append(time1)
time_vector[2] = time2
self.assertEqual(time_vector[0], time1)
self.assertEqual(time_vector[1], time2)
self.assertEqual(time_vector[2], time2)
示例3: test_time_vector
# 需要导入模块: from ert.util import TimeVector [as 别名]
# 或者: from ert.util.TimeVector import append [as 别名]
def test_time_vector(self):
time_vector = TimeVector()
time1 = CTime(datetime.datetime(2013, 8, 13, 0, 0, 0))
time2 = CTime(datetime.datetime(2013, 8, 13, 1, 0, 0))
time_vector.setDefault(time2)
time_vector.append(time1)
time_vector[2] = time2
self.assertEqual(time_vector[0], time1)
self.assertEqual(time_vector[1], time2)
self.assertEqual(time_vector[2], time2)
tv1 = TimeVector( default_value = datetime.date( 2000 , 1,1) , initial_size = 2)
self.assertEqual( tv1[0] , datetime.date(2000,1,1))
tv2 = TimeVector()
tv2.append( time2 )
print tv2