Skip to content

Commit

Permalink
Merge pull request #157 from naik-aakash/snakecase_calc_quality
Browse files Browse the repository at this point in the history
snakecase key names of calc quality summary dict
  • Loading branch information
JaGeo authored Sep 26, 2023
2 parents d97ced9 + 44bc0f5 commit b743a0d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
22 changes: 11 additions & 11 deletions lobsterpy/cohp/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -1066,18 +1066,18 @@ def get_lobster_calc_quality_summary(
else:
loew_oxi.append("NEG")

quality_dict["Charges"] = {} # type: ignore
quality_dict["charges"] = {} # type: ignore
if mull_oxi == bva_oxi:
quality_dict["Charges"]["BVA_Mulliken_agree"] = True # type: ignore
quality_dict["charges"]["BVA_Mulliken_agree"] = True # type: ignore
else:
quality_dict["Charges"]["BVA_Mulliken_agree"] = False # type: ignore
quality_dict["charges"]["BVA_Mulliken_agree"] = False # type: ignore

if mull_oxi == bva_oxi:
quality_dict["Charges"]["BVA_Loewdin_agree"] = True # type: ignore
quality_dict["charges"]["BVA_Loewdin_agree"] = True # type: ignore
else:
quality_dict["Charges"]["BVA_Loewdin_agree"] = False # type: ignore
quality_dict["charges"]["BVA_Loewdin_agree"] = False # type: ignore
except ValueError:
quality_dict["Charges"] = {} # type: ignore
quality_dict["charges"] = {} # type: ignore
warnings.warn(
"Oxidation states from BVA analyzer cannot be determined. "
"Thus BVA charge comparison will be skipped"
Expand All @@ -1098,7 +1098,7 @@ def get_lobster_calc_quality_summary(
vasprun = Vasprun(path_to_vasprun)
dos_vasp = vasprun.complete_dos

quality_dict["DOS_comparisons"] = {} # type: ignore
quality_dict["dos_comparisons"] = {} # type: ignore

for orb in dos_lobster.get_spd_dos():
if e_range[0] >= min(dos_vasp.energies) and e_range[0] >= min(
Expand Down Expand Up @@ -1158,7 +1158,7 @@ def get_lobster_calc_quality_summary(
),
4,
)
quality_dict["DOS_comparisons"][
quality_dict["dos_comparisons"][
"tanimoto_orb_{}".format(orb.name)
] = tani_orb # type: ignore

Expand All @@ -1180,8 +1180,8 @@ def get_lobster_calc_quality_summary(
tanimoto_summed = round(
dos_vasp.get_dos_fp_similarity(fp_lobster, fp_vasp, tanimoto=True), 4
)
quality_dict["DOS_comparisons"]["tanimoto_summed"] = tanimoto_summed # type: ignore
quality_dict["DOS_comparisons"]["e_range"] = [min_e, max_e] # type: ignore
quality_dict["DOS_comparisons"]["n_bins"] = n_bins # type: ignore
quality_dict["dos_comparisons"]["tanimoto_summed"] = tanimoto_summed # type: ignore
quality_dict["dos_comparisons"]["e_range"] = [min_e, max_e] # type: ignore
quality_dict["dos_comparisons"]["n_bins"] = n_bins # type: ignore

return quality_dict
4 changes: 2 additions & 2 deletions lobsterpy/cohp/describe.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ def get_calc_quality_description(quality_dict):
"bandOverlaps.lobster file is generated during the LOBSTER run."
)

elif key == "Charges":
elif key == "charges":
if val:
for charge in ["Mulliken", "Loewdin"]:
if val["BVA_{}_agree".format(charge)]:
Expand All @@ -633,7 +633,7 @@ def get_calc_quality_description(quality_dict):
"Thus BVA charge comparison is not conducted."
)

elif key == "DOS_comparisons":
elif key == "dos_comparisons":
comp_types = []
tani_index = []
for orb in val:
Expand Down

0 comments on commit b743a0d

Please sign in to comment.