本文整理汇总了Python中structure.Structure.rename方法的典型用法代码示例。如果您正苦于以下问题:Python Structure.rename方法的具体用法?Python Structure.rename怎么用?Python Structure.rename使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类structure.Structure
的用法示例。
在下文中一共展示了Structure.rename方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: PhysicalSystem
# 需要导入模块: from structure import Structure [as 别名]
# 或者: from structure.Structure import rename [as 别名]
#.........这里部分代码省略.........
self.valency = obj(**valency)
self.update()
#end def pseudize
def check_folded_system(self):
sys_folded = self.folded_system!=None
struct_folded = self.structure.folded_structure!=None
if sys_folded!=struct_folded:
self.error('folding of physical system and structure is not consistent\n system folded: {0}\n structure folded: {1}'.format(sys_folded,struct_folded))
#end if
if sys_folded and id(self.structure.folded_structure)!=id(self.folded_system.structure):
self.error('structure of folded system and folded structure are distinct\n this is not allowed and may be a developer error')
#end if
#end def check_folded_system
def change_units(self,units):
self.structure.change_units(units,folded=False)
if self.folded_system!=None:
self.folded_system.change_units(units)
#end if
#end def change_units
def group_atoms(self):
self.structure.group_atoms(folded=False)
if self.folded_system!=None:
self.folded_system.group_atoms()
#end if
#end def group_atoms
def rename(self,folded=True,**name_pairs):
self.particles.rename(**name_pairs)
self.structure.rename(folded=False,**name_pairs)
if self.pseudized:
for old,new in name_pairs.iteritems():
if old in self.valency:
if new not in self.valency:
self.valency[new] = self.valency[old]
#end if
del self.valency[old]
#end if
#end for
self.valency_in = self.valency
#end if
if self.folded_system!=None and folded:
self.folded_system.rename(folded=folded,**name_pairs)
#end if
#end def rename
def copy(self):
cp = DevBase.copy(self)
if self.folded_system!=None and self.structure.folded_structure!=None:
del cp.folded_system.structure
cp.folded_system.structure = cp.structure.folded_structure
#end if
return cp
#end def copy
def load(self,filepath):
DevBase.load(self,filepath)
if self.folded_system!=None and self.structure.folded_structure!=None: