本文整理汇总了Python中MAST.ingredients.chopingredient.ChopIngredient.get_parent_image_structures方法的典型用法代码示例。如果您正苦于以下问题:Python ChopIngredient.get_parent_image_structures方法的具体用法?Python ChopIngredient.get_parent_image_structures怎么用?Python ChopIngredient.get_parent_image_structures使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MAST.ingredients.chopingredient.ChopIngredient
的用法示例。
在下文中一共展示了ChopIngredient.get_parent_image_structures方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_parent_image_structures
# 需要导入模块: from MAST.ingredients.chopingredient import ChopIngredient [as 别名]
# 或者: from MAST.ingredients.chopingredient.ChopIngredient import get_parent_image_structures [as 别名]
def test_get_parent_image_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_01 = MASTFile("unsorted/parent_structure_labelinit-labelfin_01")
unsorted_01.to_file("%s/parent_structure_labelinit-labelfin_01" % ingdir)
unsorted_02 = MASTFile("unsorted/parent_structure_labelinit-labelfin_02")
unsorted_02.to_file("%s/parent_structure_labelinit-labelfin_02" % ingdir)
unsorted_03 = MASTFile("unsorted/parent_structure_labelinit-labelfin_03")
unsorted_03.to_file("%s/parent_structure_labelinit-labelfin_03" % ingdir)
my_structure=pymatgen.io.vaspio.Poscar.from_file("files/perfect_structure").structure
mywi = ChopIngredient(name=ingdir,program_keys=kdict,structure=my_structure)
imstrs = mywi.get_parent_image_structures()
compare_01 = pymatgen.io.vaspio.Poscar.from_file("files/parent_structure_labelinit-labelfin_01").structure
compare_02 = pymatgen.io.vaspio.Poscar.from_file("files/parent_structure_labelinit-labelfin_02").structure
compare_03 = pymatgen.io.vaspio.Poscar.from_file("files/parent_structure_labelinit-labelfin_03").structure
self.assertEqual(imstrs[0].sites, compare_01.sites)
self.assertEqual(imstrs[0].lattice, compare_01.lattice)
self.assertEqual(imstrs[1].sites, compare_02.sites)
self.assertEqual(imstrs[1].lattice, compare_02.lattice)
self.assertEqual(imstrs[2].sites, compare_03.sites)
self.assertEqual(imstrs[2].lattice, compare_03.lattice)