本文整理汇总了Python中model.jigs.Jig.setAtoms方法的典型用法代码示例。如果您正苦于以下问题:Python Jig.setAtoms方法的具体用法?Python Jig.setAtoms怎么用?Python Jig.setAtoms使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类model.jigs.Jig
的用法示例。
在下文中一共展示了Jig.setAtoms方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setAtoms
# 需要导入模块: from model.jigs import Jig [as 别名]
# 或者: from model.jigs.Jig import setAtoms [as 别名]
def setAtoms(self, atomlist): #bruce 080208 split this out of __init__ so copy is simpler
Jig.setAtoms(self, atomlist)
if len(atomlist) == _NUMBER_OF_MARKER_ATOMS:
marked_atom, next_atom = atomlist
self.marked_atom = marked_atom
self.next_atom = next_atom
assert not self._length_1_chain
elif len(atomlist) == 1 and self._length_1_chain:
#bruce 080216, for 1-atom wholechains
# (the flag test is to make sure it's only used then)
self.marked_atom = self.next_atom = atomlist[0]
else:
# We are probably being called by _copy_fixup_at_end
# with fewer or no atoms, or by __init__ in first stage of copy
# (Jig.copy_full_in_mapping) with no atoms.
# todo: would be better to make those callers tell us for sure.
# for now: print bug warning if fewer atoms but not none
# (i don't know if that can happen), and assert not too many atoms.
assert len(atomlist) <= _NUMBER_OF_MARKER_ATOMS
if atomlist:
print "bug? %r.setAtoms(%r), len != _NUMBER_OF_MARKER_ATOMS or 0" % \
(self, atomlist)
self.marked_atom = self.next_atom = None #bruce 080216
self._check_atom_order() #bruce 080216 do in all cases, was just main one
return