Skip to content

Commit

Permalink
pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
JaGeo committed Aug 26, 2021
1 parent 263045d commit f693b9a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 26 deletions.
4 changes: 3 additions & 1 deletion pymatgen/io/lobster/inputs.py
Expand Up @@ -619,7 +619,9 @@ def _get_potcar_symbols(POTCAR_input: str) -> list:
data = f.read()
if "SHA256" in data or "COPYR" in data:
warnings.warn(
"These POTCARs are not compatible with Lobster up to version 4.1.0.\n The keywords SHA256 and COPYR cannot be handled by Lobster \n and will lead to wrong results."
"These POTCARs are not compatible with Lobster up to version 4.1.0."
"\n The keywords SHA256 and COPYR cannot be handled by Lobster"
" \n and will lead to wrong results."
)

if potcar.functional != "PBE":
Expand Down
50 changes: 25 additions & 25 deletions pymatgen/io/lobster/outputs.py
Expand Up @@ -111,8 +111,8 @@ def __init__(self, are_coops: bool = False, are_cobis: bool = False, filename: s
self.is_spin_polarized = False

# The COHP data start in row num_bonds + 3
data = np.array([np.array(row.split(), dtype=float) for row in contents[num_bonds + 3 :]]).transpose()
data = np.array([np.array(row.split(), dtype=float) for row in contents[num_bonds + 3 :]]).transpose()
data = np.array([np.array(row.split(), dtype=float) for row in contents[num_bonds + 3:]]).transpose()
data = np.array([np.array(row.split(), dtype=float) for row in contents[num_bonds + 3:]]).transpose()
self.energies = data[0]
cohp_data = {
"average": {
Expand Down Expand Up @@ -331,7 +331,7 @@ def __init__(self, are_coops: bool = False, are_cobis: bool = False, filename: s

# check if orbitalwise ICOHPLIST
# include case when there is only one ICOHP!!!
if len(data) > 2 and "_" in (data[2].split()[1]):
if len(data) > 2 and "_" in data[2].split()[1]:
self.orbitalwise = True
warnings.warn("This is an orbitalwise IC**LIST.lobter. Currently, the orbitalwise information is not read!")
else:
Expand Down Expand Up @@ -479,10 +479,10 @@ class Doscar:
"""

def __init__(
self,
doscar: str = "DOSCAR.lobster",
structure_file: str = "POSCAR",
dftprogram: str = "Vasp",
self,
doscar: str = "DOSCAR.lobster",
structure_file: str = "POSCAR",
dftprogram: str = "Vasp",
):
"""
Args:
Expand Down Expand Up @@ -815,16 +815,16 @@ def __init__(self, filename="lobsterout"):

self.has_DOSCAR = "writing DOSCAR.lobster..." in data and "SKIPPING writing DOSCAR.lobster..." not in data
self.has_COHPCAR = (
"writing COOPCAR.lobster and ICOOPLIST.lobster..." in data
and "SKIPPING writing COOPCAR.lobster and ICOOPLIST.lobster..." not in data
"writing COOPCAR.lobster and ICOOPLIST.lobster..." in data
and "SKIPPING writing COOPCAR.lobster and ICOOPLIST.lobster..." not in data
)
self.has_COOPCAR = (
"writing COHPCAR.lobster and ICOHPLIST.lobster..." in data
and "SKIPPING writing COHPCAR.lobster and ICOHPLIST.lobster..." not in data
"writing COHPCAR.lobster and ICOHPLIST.lobster..." in data
and "SKIPPING writing COHPCAR.lobster and ICOHPLIST.lobster..." not in data
)
self.has_COBICAR = (
"writing COBICAR.lobster and ICOBILIST.lobster..." in data
and "SKIPPING writing COBICAR.lobster and ICOBILIST.lobster..." not in data
"writing COBICAR.lobster and ICOBILIST.lobster..." in data
and "SKIPPING writing COBICAR.lobster and ICOBILIST.lobster..." not in data
)

self.has_CHARGE = "SKIPPING writing CHARGE.lobster..." not in data
Expand All @@ -834,8 +834,8 @@ def __init__(self, filename="lobsterout"):
self.has_grosspopulation = "writing CHARGE.lobster and GROSSPOP.lobster..." in data
self.has_density_of_energies = "writing DensityOfEnergy.lobster..." in data
self.has_madelung = (
"writing SitePotentials.lobster and MadelungEnergies.lobster..." in data
and "skipping writing SitePotentials.lobster and MadelungEnergies.lobster..." not in data
"writing SitePotentials.lobster and MadelungEnergies.lobster..." in data
and "skipping writing SitePotentials.lobster and MadelungEnergies.lobster..." not in data
)

def get_doc(self):
Expand Down Expand Up @@ -1175,7 +1175,7 @@ def __init__(self, filenames=".", vasprun="vasprun.xml", Kpointsfile="KPOINTS"):
self.is_spinpolarized = True
else:
linenumbers = []
for iline, line in enumerate(contents[1 : self.nbands * 2 + 4]):
for iline, line in enumerate(contents[1: self.nbands * 2 + 4]):
if line.split()[0] == "#":
linenumbers.append(iline)

Expand Down Expand Up @@ -1261,7 +1261,7 @@ def __init__(self, filenames=".", vasprun="vasprun.xml", Kpointsfile="KPOINTS"):
self.p_eigenvals = p_eigenvals

label_dict = {}
for ilabel, label in enumerate(kpoints_object.labels[-self.number_kpts :], start=0):
for ilabel, label in enumerate(kpoints_object.labels[-self.number_kpts:], start=0):

if label is not None:
label_dict[label] = kpoints_array[ilabel]
Expand Down Expand Up @@ -1358,11 +1358,11 @@ def has_good_quality_maxDeviation(self, limit_maxDeviation: float = 0.1) -> bool
return True

def has_good_quality_check_occupied_bands(
self,
number_occ_bands_spin_up: int,
number_occ_bands_spin_down: Optional[int] = None,
spin_polarized: bool = False,
limit_deviation: float = 0.1,
self,
number_occ_bands_spin_up: int,
number_occ_bands_spin_down: Optional[int] = None,
spin_polarized: bool = False,
limit_deviation: float = 0.1,
) -> bool:
"""
will check if the deviation from the ideal bandoverlap of all occupied bands is smaller or equal to
Expand Down Expand Up @@ -1648,9 +1648,9 @@ def write_file(self, filename="WAVECAR.vasp", part="real"):
"""
if not (
hasattr(self, "volumetricdata_real")
and hasattr(self, "volumetricdata_imaginary")
and hasattr(self, "volumetricdata_density")
hasattr(self, "volumetricdata_real")
and hasattr(self, "volumetricdata_imaginary")
and hasattr(self, "volumetricdata_density")
):
self.set_volumetric_data(self.grid, self.structure)
if part == "real":
Expand Down

0 comments on commit f693b9a

Please sign in to comment.