本文整理汇总了Python中MAST.ingredients.chopingredient.ChopIngredient.get_parent_structures方法的典型用法代码示例。如果您正苦于以下问题:Python ChopIngredient.get_parent_structures方法的具体用法?Python ChopIngredient.get_parent_structures怎么用?Python ChopIngredient.get_parent_structures使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MAST.ingredients.chopingredient.ChopIngredient
的用法示例。
在下文中一共展示了ChopIngredient.get_parent_structures方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_parent_structures
# 需要导入模块: from MAST.ingredients.chopingredient import ChopIngredient [as 别名]
# 或者: from MAST.ingredients.chopingredient.ChopIngredient import get_parent_structures [as 别名]
def test_get_parent_structures(self):
kdict=dict()
kdict['mast_program'] = 'vasp_neb'
neblines = list()
neblines.append(["Cr","0.0 0.9 0.8","0.0 0.8 0.7"])
neblines.append(["Cr","0.4 0.2 0.1","0.3 0.3 0.2"])
neblines.append(["Cr","0.29 0.05 0.05","0.01 0.01 0.98"])
neblines.append(["Ni","0.61 0.99 0.98","0.25 0.01 0.97"])
kdict['mast_neb_settings']=dict()
kdict['mast_neb_settings']['images']=3
kdict['mast_neb_settings']['lines']=neblines
ingdir = "writedir/neb_labelinit-labelfin"
topmetad = MASTFile("files/top_metadata_neb")
topmetad.to_file("writedir/metadata.txt")
metad = MASTFile("files/metadata_neb")
metad.to_file("%s/metadata.txt" % ingdir)
unsorted_init = MASTFile("unsorted/parent_structure_labelinit")
#unsorted_init = MASTFile("unsorted/parent_structure_labelinit_scrambled")
unsorted_init.to_file("%s/parent_structure_labelinit" % ingdir)
unsorted_fin = MASTFile("unsorted/parent_structure_labelfin")
unsorted_fin.to_file("%s/parent_structure_labelfin" % ingdir)
my_structure=pymatgen.io.vaspio.Poscar.from_file("files/perfect_structure").structure
mywi = ChopIngredient(name=ingdir,program_keys=kdict,structure=my_structure)
[sinit, sfin] = mywi.get_parent_structures()
init_compare = pymatgen.io.vaspio.Poscar.from_file("files/parent_structure_labelinit").structure
fin_compare = pymatgen.io.vaspio.Poscar.from_file("files/parent_structure_labelfin").structure
#print sinit
#print init_compare
#print sfin
#print fin_compare
self.assertEqual(sinit.sites, init_compare.sites)
self.assertEqual(sinit.lattice, init_compare.lattice)
self.assertEqual(sfin.sites, fin_compare.sites)
self.assertEqual(sfin.lattice, fin_compare.lattice)