place.py (pymol-open-source-2.2.0) | : | place.py (pymol-open-source-2.3.0) | ||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
# | # | |||
# | # | |||
# | # | |||
from __future__ import print_function | from __future__ import print_function | |||
from . import bond_amber | from . import bond_amber | |||
from chempy.cpv import * | from chempy.cpv import * | |||
from chempy import feedback | from chempy import feedback | |||
import chempy.models | ||||
TET_TAN = 1.41 | TET_TAN = 1.41 | |||
TRI_TAN = 1.732 | TRI_TAN = 1.732 | |||
#------------------------------------------------------------------------------ | #------------------------------------------------------------------------------ | |||
def find_known_secondary(model,anchor,known_list): | def find_known_secondary(model,anchor,known_list): | |||
at = model.atom[anchor] | at = model.atom[anchor] | |||
h_list = [] | h_list = [] | |||
for id in known_list: | for id in known_list: | |||
for b in model.bond[id]: | for b in model.bond[id]: | |||
skipping to change at line 54 | skipping to change at line 55 | |||
if len(h_list): # only return hydrogen as a last resort | if len(h_list): # only return hydrogen as a last resort | |||
return h_list[0] | return h_list[0] | |||
return None | return None | |||
#------------------------------------------------------------------------------ | #------------------------------------------------------------------------------ | |||
def simple_unknowns(model,bondfield=bond_amber): | def simple_unknowns(model,bondfield=bond_amber): | |||
if feedback['actions']: | if feedback['actions']: | |||
print(" "+str(__name__)+": placing unknowns...") | print(" "+str(__name__)+": placing unknowns...") | |||
# this can be used to build hydrogens and would robably work for | # this can be used to build hydrogens and would robably work for | |||
# acyclic carbons as well | # acyclic carbons as well | |||
if str(model.__class__) != 'chempy.models.Connected': | if not isinstance(model, chempy.models.Connected): | |||
raise ValueError('model is not a "Connected" model object') | raise ValueError('model is not a "Connected" model object') | |||
if model.nAtom: | if model.nAtom: | |||
if not model.index: | if not model.index: | |||
model.update_index() | model.update_index() | |||
idx = model.index | idx = model.index | |||
last_count = -1 | last_count = -1 | |||
while 1: | while 1: | |||
need = [ [], [], [], [] ] | need = [ [], [], [], [] ] | |||
bnd_len = bondfield.length | bnd_len = bondfield.length | |||
# find known atoms with missing neighbors, and keep track of the neighbors | # find known atoms with missing neighbors, and keep track of the neighbors | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 2 lines changed or added |