Skip to content

Commit

Permalink
Tidying
Browse files Browse the repository at this point in the history
  • Loading branch information
utf committed Jul 3, 2022
1 parent 13e752d commit 718ba9a
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 24 deletions.
10 changes: 4 additions & 6 deletions sumo/cli/bandplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,7 @@ def bandplot(
else:
logging.info(f"Found PDOS file {pdos_file}")
else:
logging.info(
f"Cell file {cell_file} does not exist, " "cannot plot PDOS."
)
logging.info(f"Cell file {cell_file} does not exist, cannot plot PDOS.")

dos, pdos = read_castep_dos(
dos_file,
Expand Down Expand Up @@ -641,21 +639,21 @@ def _get_parser():
"--mode",
default="rgb",
type=str,
help=("mode for orbital projections (options: rgb, " "stacked)"),
help=("mode for orbital projections (options: rgb, stacked)"),
)
parser.add_argument(
"--normalise",
default="all",
type=str,
help=("how to normalise projections (options: all, " "select)"),
help=("how to normalise projections (options: all, select)"),
)
parser.add_argument(
"--interpolate-factor",
type=int,
default=4,
dest="interpolate_factor",
metavar="N",
help=("interpolate factor for band structure " "projections (default: 4)"),
help=("interpolate factor for band structure projections (default: 4)"),
)
parser.add_argument(
"--cartesian",
Expand Down
2 changes: 1 addition & 1 deletion sumo/cli/bandstats.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def _get_parser():
"--nonparabolic",
default=True,
action="store_false",
help=("use a nonparabolic model to fit the " "effective masses"),
help=("use a nonparabolic model to fit the effective masses"),
)
parser.add_argument(
"-s",
Expand Down
2 changes: 1 addition & 1 deletion sumo/cli/dosplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def dosplot(

if shift:
logging.warning(
"Fermi level shift requested, but not implemented " "for Questaal DOS."
"Fermi level shift requested, but not implemented for Questaal DOS."
)

dos, pdos = sumo.io.questaal.read_dos(
Expand Down
4 changes: 2 additions & 2 deletions sumo/cli/kgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,10 @@ def _parse_ibzkpt(ibzkpt):
try:
ibz = Kpoints.from_file(ibzkpt)
if ibz.tet_number != 0:
logging.error("\nERROR: IBZKPT contains tetrahedron " "information.")
logging.error("\nERROR: IBZKPT contains tetrahedron information.")
sys.exit()
except OSError:
logging.error("\nERROR: Hybrid specified but no IBZKPT file " "found.")
logging.error("\nERROR: Hybrid specified but no IBZKPT file found.")
sys.exit()
else:
ibz = None
Expand Down
12 changes: 6 additions & 6 deletions sumo/cli/phonon_bandplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,14 +520,14 @@ def _get_parser():
metavar="M",
dest="primitive_axis",
default=None,
help="conventional to primitive cell " "transformation matrix",
help="conventional to primitive cell transformation matrix",
)
prim_axis.add_argument(
"--primitive-auto",
action="store_const",
dest="primitive_axis",
const="auto",
help="Let phonopy automatically determine primitive" " cell transformation",
help="Let phonopy automatically determine primitive cell transformation",
)
parser.add_argument(
"--symprec",
Expand All @@ -541,7 +541,7 @@ def _get_parser():
metavar="UNITS",
default="THz",
choices=("THz", "thz", "cm-1", "eV", "ev", "meV", "mev"),
help=("choose units of phonon frequency " "(THz, cm-1, eV, meV)"),
help=("choose units of phonon frequency (THz, cm-1, eV, meV)"),
)
parser.add_argument(
"--spg", type=str, default=None, help="space group number or symbol"
Expand Down Expand Up @@ -569,13 +569,13 @@ def _get_parser():
"--kpoints",
type=str,
default=None,
help=("specify a list of kpoints " '(e.g. "0 0 0, 0.5 0 0")'),
help=('specify a list of kpoints (e.g. "0 0 0, 0.5 0 0")'),
)
parser.add_argument(
"--labels",
type=str,
default=None,
help=("specify the labels for kpoints " r'(e.g. "\Gamma,X")'),
help=r'specify the labels for kpoints (e.g. "\Gamma,X")',
)
parser.add_argument(
"--height", type=float, default=None, help="height of the graph"
Expand Down Expand Up @@ -639,7 +639,7 @@ def _get_parser():
type=str,
default=None,
dest="to_web",
help="(Output JSON file for " "http://henriquemiranda.github.io/phononwebsite)",
help="(Output JSON file for http://henriquemiranda.github.io/phononwebsite)",
)
parser.add_argument(
"--legend",
Expand Down
6 changes: 3 additions & 3 deletions sumo/io/castep.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def read_dos(
if pdos_file is not None and not total_only:
if cell_file is None:
raise OSError(
f"Cell file {cell_file} not found: this must be " "provided for PDOS."
f"Cell file {cell_file} not found: this must be provided for PDOS."
)
pdos_raw = compute_pdos(pdos_file, eigenvalues, weights, bins)
# Also we, need to read the structure, but have it sorted with increasing
Expand Down Expand Up @@ -481,7 +481,7 @@ def labels_from_cell(cell_file, phonon=False):
while blockstart.match(line.lower()) is None:
line = f.readline()
if line == "":
logging.error("Could not find start of k-point block in " "cell file.")
logging.error("Could not find start of k-point block in cell file.")
sys.exit()

line = f.readline() # Skip past block start line
Expand All @@ -494,7 +494,7 @@ def labels_from_cell(cell_file, phonon=False):
labels[label] = kpt
line = f.readline()
if line == "":
logging.error("Could not find end of k-point block in " "cell file.")
logging.error("Could not find end of k-point block in cell file.")
sys.exit()

return labels
Expand Down
6 changes: 3 additions & 3 deletions sumo/io/questaal.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,12 @@ def _get_structure_from_spcgrp(self):
)
self.lattice["GAMMA"] = 120
else:
logging.info("Lattice angle GAMMA not given, " "assume right-angle")
logging.info("Lattice angle GAMMA not given, assume right-angle")
self.lattice["GAMMA"] = 90

if self.cartesian:
logging.info(
"Warning: Cartesian positions used without " "explicit lattice vectors"
"Warning: Cartesian positions used without explicit lattice vectors"
)

if "UNITS" not in self.lattice or self.lattice["UNITS"] is None:
Expand Down Expand Up @@ -562,7 +562,7 @@ def write_kpoint_files(
if e.errno == errno.EEXIST:
import sys

logging.error("\nERROR: Folders already exist, won't " "overwrite.")
logging.error("\nERROR: Folders already exist, won't overwrite.")
sys.exit()
else:
raise
Expand Down
2 changes: 1 addition & 1 deletion sumo/io/vasp.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def write_kpoint_files(
os.makedirs(folder)
except OSError as e:
if e.errno == errno.EEXIST:
logging.error("\nERROR: Folders already exist, won't " "overwrite.")
logging.error("\nERROR: Folders already exist, won't overwrite.")
sys.exit()
else:
raise
Expand Down
2 changes: 1 addition & 1 deletion sumo/plotting/dos_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def dos_plot_data(
energy_shift = -dos.efermi if zero_to_efermi else 0.0
elif zero_to_efermi:
raise ValueError(
"Cannot use zero_energy and " "zero_to_efermi simultaneously."
"Cannot use zero_energy and zero_to_efermi simultaneously."
)
else:
energy_shift = -zero_energy
Expand Down

0 comments on commit 718ba9a

Please sign in to comment.