本文整理汇总了Python中module.Module.add_property方法的典型用法代码示例。如果您正苦于以下问题:Python Module.add_property方法的具体用法?Python Module.add_property怎么用?Python Module.add_property使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类module.Module
的用法示例。
在下文中一共展示了Module.add_property方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: write_london
# 需要导入模块: from module import Module [as 别名]
# 或者: from module.Module import add_property [as 别名]
def write_london(template, scf, molecule):
printable = ''
wave_function = scf.contains(template.wave_function.name)
if wave_function:
scf_submodule = wave_function.submodules.get(template.scf.name)
if scf_submodule:
atomst = scf_submodule.properties.pop(template.atomst.name)
for module in scf.modules:
if module.name != template.visual.name:
printable += module.__str__()
nmr = SubModule('*NMR')
nmr.add_property(template, '.LONDON')
nmr.add_property(template, '.DOEPRN')
nmr.add_property(template, '.INTFLG', ['1 1 0'])#calculating just large-large large-small
newModule = Module('**PROPERTIES')
newModule.add_property(template, '.' + molecule.magnetic_field)
newModule.submodules.update({'*NMR':nmr})
printable += newModule.__str__()
printable += '*END OF\n'
if atomst:
scf_submodule.properties.update({atomst.name:atomst})
return printable
示例2: derive_visual
# 需要导入模块: from module import Module [as 别名]
# 或者: from module.Module import add_property [as 别名]
def derive_visual(self, template):
visual = Module(template.visual.name)
#jdia property
if self.hamiltonian.properties.get(template.lvcorr.name):
visual.add_property(template, template.jdia.name, ['PAMXVC 2'])
elif self.hamiltonian.properties.get(template.levy_leblond.name):
visual.add_property(template, template.jdia.name, ['DFCOEF'] )
visual.add_property(template, template.noreortho.name )
visual.add_property(template, template.nodirect.name )
else:
raise MissingInformation('Missing hamiltonian module from scf.inp file')
visual.add_property(template, template.j.name, ['PAMXVC 1'])
visual.add_property(template, template.london.name, [self.molecule.p_axis])
# two_d
biggest_ = str(math.ceil(self.molecule.biggest_coordinate * 2))
fst_point = ['-' + biggest_, '-' + biggest_]
snd_point = [biggest_, '-' + biggest_]
trd_point = ['-' + biggest_, biggest_]
index = 0 if self.molecule.p_axis == 'X' else 1 if self.molecule.p_axis == 'Y' else 2
fst_point.insert(index, '1.0')
snd_point.insert(index, '1.0')
trd_point.insert(index, '1.0')
values_for_two_d = []
values_for_two_d.append(' '.join(fst_point))
values_for_two_d.append(' '.join(snd_point))
values_for_two_d.append('200')
values_for_two_d.append(' '.join(trd_point))
values_for_two_d.append('200')
visual.add_property(template, template.two_d.name, values_for_two_d)
self.scf.addModule(visual)