本文整理汇总了Python中pele.storage.Database.getTransitionStateFromID方法的典型用法代码示例。如果您正苦于以下问题:Python Database.getTransitionStateFromID方法的具体用法?Python Database.getTransitionStateFromID怎么用?Python Database.getTransitionStateFromID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pele.storage.Database
的用法示例。
在下文中一共展示了Database.getTransitionStateFromID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestDB
# 需要导入模块: from pele.storage import Database [as 别名]
# 或者: from pele.storage.Database import getTransitionStateFromID [as 别名]
#.........这里部分代码省略.........
self.assertEqual(self.nminima, self.db.number_of_minima())
def test_number_of_transition_states(self):
self.assertEqual(self.nts, self.db.number_of_transition_states())
def test_highest_energy_minimum(self):
m1 = self.db._highest_energy_minimum()
m2 = self.db.minima()[-1]
self.assertEqual(m1, m2)
def test_maximum_number_of_minima(self):
m = self.db.addMinimum(-1., [-1.], max_n_minima=self.nminima)
self.assertEqual(self.nminima, self.db.number_of_minima())
self.assertIn(m, self.db.minima())
def test_maximum_number_of_minima_largestE(self):
e = float(self.nminima + 1)
m = self.db.addMinimum(e, [e], max_n_minima=self.nminima)
self.assertEqual(self.nminima, self.db.number_of_minima())
self.assertIsNone(m)
#ensure the highest energy minimum is still in the database
mmax = self.db._highest_energy_minimum()
self.assertEqual(mmax.energy, float(self.nminima-1))
def test_maximum_number_of_minima_minima_adder(self):
ma = self.db.minimum_adder(max_n_minima=self.nminima)
m = ma(-1., [-1.])
self.assertEqual(self.nminima, self.db.number_of_minima())
self.assertIn(m, self.db.minima())
def test_getTSfromID(self):
ts = self.db.transition_states()[0]
ts1 = self.db.getTransitionStateFromID(ts._id)
self.assertEqual(ts, ts1)
def test_property(self):
# add some system properties and ensure they were added correctly
self.db.add_property("natoms", 10)
p = self.db.get_property("natoms")
self.assertEqual(p.value(), 10)
self.db.add_property("eps", 2.1)
p = self.db.get_property("eps")
self.assertEqual(p.value(), 2.1)
self.db.add_property("author", "Jake")
p = self.db.get_property("author")
self.assertEqual(p.value(), "Jake")
self.db.add_property("data", [1, 2])
p = self.db.get_property("data")
self.assertEqual(p.value(), [1, 2])
# assert that the not set values are None
p = self.db.get_property("natoms")
self.assertIsNone(p.string_value)
self.assertIsNone(p.float_value)
self.assertIsNone(p.pickle_value)
p = self.db.get_property("noprop")
self.assertIsNone(p)
props = self.db.properties(as_dict=True)
self.assertIsInstance(props, dict)
self.assertDictContainsSubset(dict(natoms=10), props)
self.assertEqual(len(props.items()), 4)