Skip to content

Commit

Permalink
Fixes from #216
Browse files Browse the repository at this point in the history
  • Loading branch information
utf committed Oct 11, 2023
1 parent 9d6b00e commit 6e05b66
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 34 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"h5py",
"pymatgen>=2020.10.20",
"phonopy>=2.1.3",
"matplotlib",
"matplotlib>=3.2.0",
"seekpath",
"castepxbin<1.0",
"colormath",
Expand Down
14 changes: 4 additions & 10 deletions sumo/cli/bandplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,24 +762,20 @@ def _get_parser():
"--orbitals",
type=_el_orb,
metavar="O",
help=(
"orbitals to split into lm-decomposed "
'contributions (e.g. "Ru.d")'
),
help="orbitals to split into lm-decomposed contributions (e.g. 'Ru.d')",
)
parser.add_argument(
"--atoms",
type=_atoms,
metavar="A",
help=('atoms to include (e.g. "O.1.2.3,Ru.1.2.3")'),
help='atoms to include (e.g. "O.1.2.3,Ru.1.2.3")',
)
parser.add_argument(
"--spin",
type=str,
default=None,
help=(
"select only one spin channel for a "
"spin-polarised calculation "
"select only one spin channel for a spin-polarised calculation "
"(options: up, 1; down, -1)"
),
)
Expand Down Expand Up @@ -883,9 +879,7 @@ def main():
logging.getLogger("").addHandler(console)

if args.config is None:
config_path = os.path.join(
ilr_files("sumo.plotting"), "orbital_colours.conf"
)
config_path = ilr_files("sumo.plotting") / "orbital_colours.conf"
else:
config_path = args.config
colours = configparser.ConfigParser()
Expand Down
18 changes: 5 additions & 13 deletions sumo/cli/dosplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,9 +441,7 @@ def _get_parser():
"--code",
default="vasp",
metavar="C",
help=(
'Input file format: "vasp" (vasprun.xml) or ' '"questaal" (opt.ext)'
),
help='Input file format: "vasp" (vasprun.xml) or "questaal" (opt.ext)',
)
parser.add_argument(
"-p", "--prefix", metavar="P", help="prefix for the files generated"
Expand All @@ -463,25 +461,21 @@ def _get_parser():
"--orbitals",
type=_el_orb,
metavar="O",
help=(
"orbitals to split into lm-decomposed "
'contributions (e.g. "Ru.d")'
),
help="orbitals to split into lm-decomposed contributions (e.g. 'Ru.d')",
)
parser.add_argument(
"-a",
"--atoms",
type=_atoms,
metavar="A",
help=('atoms to include (e.g. "O.1.2.3,Ru.1.2.3")'),
help='atoms to include (e.g. "O.1.2.3,Ru.1.2.3")',
)
parser.add_argument(
"--spin",
type=str,
default=None,
help=(
"select one spin channel only for a "
"spin-polarised calculation "
"select one spin channel only for a spin-polarised calculation "
"(options: up, 1; down, -1)"
),
)
Expand Down Expand Up @@ -634,9 +628,7 @@ def main():
logging.getLogger("").addHandler(console)

if args.config is None:
config_path = os.path.join(
ilr_files("sumo.plotting"), "orbital_colours.conf"
)
config_path = ilr_files("sumo.plotting") / "orbital_colours.conf"
else:
config_path = args.config
colours = configparser.ConfigParser()
Expand Down
14 changes: 5 additions & 9 deletions sumo/plotting/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,11 @@

colour_cache = {}

sumo_base_style = os.path.join(ilr_files("sumo.plotting"), "sumo_base.mplstyle")
sumo_dos_style = os.path.join(ilr_files("sumo.plotting"), "sumo_dos.mplstyle")
sumo_bs_style = os.path.join(ilr_files("sumo.plotting"), "sumo_bs.mplstyle")
sumo_phonon_style = os.path.join(
ilr_files("sumo.plotting"), "sumo_phonon.mplstyle"
)
sumo_optics_style = os.path.join(
ilr_files("sumo.plotting"), "sumo_optics.mplstyle"
)
sumo_base_style = ilr_files("sumo.plotting") / "sumo_base.mplstyle"
sumo_dos_style = ilr_files("sumo.plotting") / "sumo_dos.mplstyle"
sumo_bs_style = ilr_files("sumo.plotting") / "sumo_bs.mplstyle"
sumo_phonon_style = ilr_files("sumo.plotting") / "sumo_phonon.mplstyle"
sumo_optics_style = ilr_files("sumo.plotting") / "sumo_optics.mplstyle"


def styled_plot(*style_sheets):
Expand Down
2 changes: 1 addition & 1 deletion sumo/symmetry/brad_crack_kpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def _get_bradcrack_data(bravais):
'path': [['\Gamma', 'X', ..., 'P'], ['H', 'N', ...]]}
"""
json_file = os.path.join(ilr_files("sumo.symmetry"), "bradcrack.json")
json_file = ilr_files("sumo.symmetry") / "bradcrack.json"
with open(json_file) as f:
bradcrack_data = load_json(f)
return bradcrack_data[bravais]
Expand Down

0 comments on commit 6e05b66

Please sign in to comment.