From c7c54f25f26071edd0230603d8323a3b6c600014 Mon Sep 17 00:00:00 2001 From: Shyue Ping Ong Date: Mon, 24 Jun 2024 12:48:07 -0700 Subject: [PATCH] Fix pyright. --- custodian/cli/run_vasp.py | 4 ++-- custodian/qchem/jobs.py | 10 +++++----- custodian/vasp/handlers.py | 2 +- custodian/vasp/jobs.py | 4 ++-- custodian/vasp/utils.py | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/custodian/cli/run_vasp.py b/custodian/cli/run_vasp.py index aa940a7c..97f50541 100644 --- a/custodian/cli/run_vasp.py +++ b/custodian/cli/run_vasp.py @@ -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 } }, } diff --git a/custodian/qchem/jobs.py b/custodian/qchem/jobs.py index 23bd4f34..8e386e27 100644 --- a/custodian/qchem/jobs.py +++ b/custodian/qchem/jobs.py @@ -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: @@ -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 = ( @@ -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, diff --git a/custodian/vasp/handlers.py b/custodian/vasp/handlers.py index a58d2398..19eedb52 100644 --- a/custodian/vasp/handlers.py +++ b/custodian/vasp/handlers.py @@ -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 diff --git a/custodian/vasp/jobs.py b/custodian/vasp/jobs.py index d9bc92f9..ffef7ea8 100644 --- a/custodian/vasp/jobs.py +++ b/custodian/vasp/jobs.py @@ -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}") @@ -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, diff --git a/custodian/vasp/utils.py b/custodian/vasp/utils.py index 917760db..e374f757 100644 --- a/custodian/vasp/utils.py +++ b/custodian/vasp/utils.py @@ -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]),), @@ -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