本文整理汇总了Python中chemlab.core.System.guess_bonds方法的典型用法代码示例。如果您正苦于以下问题:Python System.guess_bonds方法的具体用法?Python System.guess_bonds怎么用?Python System.guess_bonds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类chemlab.core.System
的用法示例。
在下文中一共展示了System.guess_bonds方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_bond_guessing
# 需要导入模块: from chemlab.core import System [as 别名]
# 或者: from chemlab.core.System import guess_bonds [as 别名]
def test_bond_guessing():
from chemlab.db import ChemlabDB, CirDB
from chemlab.graphics import display_molecule
from chemlab.io import datafile
mol = datafile('tests/data/3ZJE.pdb').read('molecule')
print(mol.r_array)
mol.guess_bonds()
assert mol.bonds.size > 0
# We should find the bond guessing also for systems
# System Made of two benzenes
bz = datafile("tests/data/benzene.mol").read('molecule')
bzbonds = bz.bonds
bz.bonds = np.array([])
# Separating the benzenes by large amount
bz2 = bz.copy()
bz2.r_array += 2.0
s = System([bz, bz2])
s.guess_bonds()
assert_eqbonds(s.bonds, np.concatenate((bzbonds, bzbonds + 6)))
# Separating benzenes by small amount
bz2 = bz.copy()
bz2.r_array += 0.15
s = System([bz, bz2])
s.guess_bonds()
assert_eqbonds(s.bonds, np.concatenate((bzbonds, bzbonds + 6)))
示例2: test_bond_guessing
# 需要导入模块: from chemlab.core import System [as 别名]
# 或者: from chemlab.core.System import guess_bonds [as 别名]
def test_bond_guessing():
# We should find the bond guessing also for systems
# System Made of two benzenes
bz = datafile("tests/data/benzene.mol").read("molecule")
bzbonds = bz.bonds
bz.bonds = np.array([])
# Separating the benzenes by large amount
bz2 = bz.copy()
bz2.r_array += 2.0
s = System([bz, bz2])
s.guess_bonds()
assert_eqbonds(s.bonds, np.concatenate((bzbonds, bzbonds + 6)))
# Separating benzenes by small amount
bz2 = bz.copy()
bz2.r_array += 0.15
s = System([bz, bz2])
s.guess_bonds()
assert_eqbonds(s.bonds, np.concatenate((bzbonds, bzbonds + 6)))