Skip to content

Commit

Permalink
Fix pyright.
Browse files Browse the repository at this point in the history
  • Loading branch information
shyuep committed Jun 24, 2024
1 parent 4497ac1 commit c7c54f2
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions custodian/cli/run_vasp.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ def get_jobs(args):
"dict": "INCAR",
"action": {
"_set": {
"LDAUJ": [j * f for j in ldauj],
"LDAUU": [u * f for u in ldauu],
"LDAUJ": [j * f for j in ldauj], # type: ignore
"LDAUU": [u * f for u in ldauu], # type: ignore
}
},
}
Expand Down
10 changes: 5 additions & 5 deletions custodian/qchem/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ def opt_with_frequency_flattener(
freq_1 = outdata.get("frequencies")[1]
if freq_0 > 0.0:
warnings.warn("All frequencies positive!")
if opt_outdata.get("final_energy") > orig_energy:
if opt_outdata.get("final_energy") > orig_energy: # type: ignore
warnings.warn("WARNING: Energy increased during frequency flattening!")
break
if abs(freq_0) < 15.0 and freq_1 > 0.0:
Expand Down Expand Up @@ -662,10 +662,10 @@ def opt_with_frequency_flattener(
reversed_direction=reversed_direction,
)
new_molecule = Molecule(
species=orig_species,
species=orig_species, # type: ignore
coords=new_coords,
charge=orig_charge,
spin_multiplicity=orig_multiplicity,
charge=orig_charge, # type: ignore
spin_multiplicity=orig_multiplicity, # type: ignore
)
if check_connectivity and not transition_state:
structure_successfully_perturbed = (
Expand All @@ -680,7 +680,7 @@ def opt_with_frequency_flattener(
)

new_opt_QCInput = QCInput(
molecule=new_molecule,
molecule=new_molecule, # type: ignore
rem=opt_rem,
opt=orig_opt_input.opt,
pcm=orig_opt_input.pcm,
Expand Down
2 changes: 1 addition & 1 deletion custodian/vasp/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def correct(self, directory="./"):
len(vi["POSCAR"].structure) < self.num_sites_kpoint_cutoff
and (new_kpoints == {})
and (self.error_count["dentet"] < 2)
and (uses_kspacing or uses_auto_kpoints)
and (uses_kspacing or uses_auto_kpoints) # type: ignore
):
# 2. Try to increase k-point density consistent with lattice geometry
# Enforce minimum number of k-points = 4 for tetrahedron method
Expand Down
4 changes: 2 additions & 2 deletions custodian/vasp/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def __init__(
vasp_path = which(vasp_cmd.split(" ")[-1])
elif isinstance(vasp_cmd, list):
vasp_path = which(vasp_cmd[-1])
scope.set_tag("vasp_path", vasp_path)
scope.set_tag("vasp_path", vasp_path) # type: ignore
scope.set_tag("vasp_cmd", vasp_cmd)
except Exception:
logger.exception(f"Failed to detect VASP path: {vasp_cmd}")
Expand Down Expand Up @@ -499,7 +499,7 @@ def full_opt_run(
},
]
if step == 1 and half_kpts_first_relax:
settings.append({"dict": "KPOINTS", "action": {"_set": orig_kpts_dict}})
settings.append({"dict": "KPOINTS", "action": {"_set": orig_kpts_dict}}) # type: ignore
logger.info(f"Generating job = {step + 1}!")
yield VaspJob(
vasp_cmd,
Expand Down
4 changes: 2 additions & 2 deletions custodian/vasp/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def increase_k_point_density(
new_kpoints = {"KSPACING": round(kpoints / mult_fac, 6), "KGAMMA": force_gamma} # type: ignore[operator]
new_nk = _estimate_num_k_points_from_kspacing(structure, new_kpoints["KSPACING"])
else:
kpts = Kpoints.automatic_density(structure, mult_fac * kppa, force_gamma=force_gamma)
kpts = Kpoints.automatic_density(structure, mult_fac * kppa, force_gamma=force_gamma) # type: ignore
new_kpoints = {
"generation_style": str(kpts.style),
"kpoints": (tuple(kpts.kpts[0]),),
Expand All @@ -101,4 +101,4 @@ def increase_k_point_density(

mult_fac += factor

return new_kpoints if success else {}
return new_kpoints if success else {} # type: ignore

0 comments on commit c7c54f2

Please sign in to comment.