def make_calc_results(args): for d in args.dirs: logger.info(f"Parsing data in {d} ...") calc_results = make_calc_results_from_vasp( vasprun=Vasprun(d / defaults.vasprun), outcar=Outcar(d / defaults.outcar)) calc_results.to_json_file(filename=Path(d) / "calc_results.json")
def test_make_calc_results_from_vasp_results(vasp_files): vasprun = Vasprun(vasp_files / "MgO_conv_Va_O_0" / "vasprun.xml") outcar = Outcar(vasp_files / "MgO_conv_Va_O_0" / "OUTCAR") results = make_calc_results_from_vasp(vasprun, outcar) expected_structure = \ Structure.from_file(vasp_files / "MgO_conv_Va_O_0" / "CONTCAR") assert results.structure == expected_structure assert results.energy == -34.91084360 assert results.magnetization == 1.03e-05 assert results.potentials ==\ [35.9483, 36.066, 35.948, 35.9478, 69.799, 69.7994, 69.7995]
def _inner(_dir: Path): calc_results = make_calc_results_from_vasp( vasprun=Vasprun(_dir / defaults.vasprun), outcar=Outcar(_dir / defaults.outcar)) calc_results.to_json_file(str(_dir / "calc_results.json"))
def calc_results(vasp_files): vasprun = Vasprun(vasp_files / "MgO_conv_Va_O_0" / "vasprun.xml") outcar = Outcar(vasp_files / "MgO_conv_Va_O_0" / "OUTCAR") return make_calc_results_from_vasp(vasprun, outcar)