本文整理汇总了Python中pymatgen.io.vasp.outputs.Vasprun.update_potcar_spec方法的典型用法代码示例。如果您正苦于以下问题:Python Vasprun.update_potcar_spec方法的具体用法?Python Vasprun.update_potcar_spec怎么用?Python Vasprun.update_potcar_spec使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pymatgen.io.vasp.outputs.Vasprun
的用法示例。
在下文中一共展示了Vasprun.update_potcar_spec方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_update_potcar
# 需要导入模块: from pymatgen.io.vasp.outputs import Vasprun [as 别名]
# 或者: from pymatgen.io.vasp.outputs.Vasprun import update_potcar_spec [as 别名]
def test_update_potcar(self):
filepath = os.path.join(test_dir, "vasprun.xml")
potcar_path = os.path.join(test_dir, "POTCAR.LiFePO4.gz")
potcar_path2 = os.path.join(test_dir, "POTCAR2.LiFePO4.gz")
vasprun = Vasprun(filepath, parse_potcar_file=False)
self.assertEqual(
vasprun.potcar_spec,
[
{"titel": "PAW_PBE Li 17Jan2003", "hash": None},
{"titel": "PAW_PBE Fe 06Sep2000", "hash": None},
{"titel": "PAW_PBE Fe 06Sep2000", "hash": None},
{"titel": "PAW_PBE P 17Jan2003", "hash": None},
{"titel": "PAW_PBE O 08Apr2002", "hash": None},
],
)
vasprun.update_potcar_spec(potcar_path)
self.assertEqual(
vasprun.potcar_spec,
[
{"titel": "PAW_PBE Li 17Jan2003", "hash": "65e83282d1707ec078c1012afbd05be8"},
{"titel": "PAW_PBE Fe 06Sep2000", "hash": "9530da8244e4dac17580869b4adab115"},
{"titel": "PAW_PBE Fe 06Sep2000", "hash": "9530da8244e4dac17580869b4adab115"},
{"titel": "PAW_PBE P 17Jan2003", "hash": "7dc3393307131ae67785a0cdacb61d5f"},
{"titel": "PAW_PBE O 08Apr2002", "hash": "7a25bc5b9a5393f46600a4939d357982"},
],
)
vasprun2 = Vasprun(filepath, parse_potcar_file=False)
self.assertRaises(ValueError, vasprun2.update_potcar_spec, potcar_path2)
vasprun = Vasprun(filepath, parse_potcar_file=potcar_path)
self.assertEqual(
vasprun.potcar_spec,
[
{"titel": "PAW_PBE Li 17Jan2003", "hash": "65e83282d1707ec078c1012afbd05be8"},
{"titel": "PAW_PBE Fe 06Sep2000", "hash": "9530da8244e4dac17580869b4adab115"},
{"titel": "PAW_PBE Fe 06Sep2000", "hash": "9530da8244e4dac17580869b4adab115"},
{"titel": "PAW_PBE P 17Jan2003", "hash": "7dc3393307131ae67785a0cdacb61d5f"},
{"titel": "PAW_PBE O 08Apr2002", "hash": "7a25bc5b9a5393f46600a4939d357982"},
],
)
self.assertRaises(ValueError, Vasprun, filepath, parse_potcar_file=potcar_path2)