Skip to content

Commit e66e1de

Browse files
authored
Merge pull request #321 from naik-aakash/update_doc
Fix unexpected "DOSCAR.LSO.lobster" exception in cli
2 parents 64d35d9 + 4ea7de1 commit e66e1de

File tree

3 files changed

+56
-50
lines changed

3 files changed

+56
-50
lines changed

Diff for: src/lobsterpy/cli.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ def run(args):
10751075
)
10761076
else:
10771077
dos_files = get_file_paths(
1078-
path_to_lobster_calc=Path(os.getcwd()), requested_files=["vasprun", "doscar"]
1078+
path_to_lobster_calc=Path(os.getcwd()), requested_files=["vasprun", "doscar"], use_lso_dos=False
10791079
)
10801080
for arg_name in dos_files:
10811081
setattr(args, arg_name, dos_files[arg_name])

Diff for: src/lobsterpy/plotting/layout_dicts.py

+49-49
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323
}
2424

2525
"""
26-
General layout of Plotly figure.
27-
28-
:param dict titlefont: Line style dictionary.
29-
:param bool showlegend: Legend hide or show.
30-
:param float title_x: x axis title size.
31-
:param float title_y: y axis title size.
32-
:param str hovermode: hover behaviour.
33-
:param str paper_bgcolor: background color.
34-
:param str plot_bgcolor: plot background color.
26+
General layout of Plotly figure.
27+
28+
:param dict titlefont: Line style dictionary.
29+
:param bool showlegend: Legend hide or show.
30+
:param float title_x: x axis title size.
31+
:param float title_y: y axis title size.
32+
:param str hovermode: hover behaviour.
33+
:param str paper_bgcolor: background color.
34+
:param str plot_bgcolor: plot background color.
3535
"""
3636

3737
cohp_axis_style_dict = {
@@ -50,20 +50,20 @@
5050
}
5151

5252
"""
53-
COXX axis style.
54-
55-
:param dict titlefont: axis title font style.
56-
:param dict tickfont: axis tick font style.
57-
:param str ticks: ticks style.
58-
:param float tickwidth: width of ticks.
59-
:param bool showgrid: show or hide axis grid.
60-
:param bool showline: show or hide axis.
61-
:param bool zeroline: show or hide zero line.
62-
:param str zerolinecolor: color of zero line.
63-
:param float zerolinewidth: width of zero line.
64-
:param bool mirror: mirror axis.
65-
:param float linewidth: width of axis line.
66-
:param str linecolor: color of axis line.
53+
COXX axis style.
54+
55+
:param dict titlefont: axis title font style.
56+
:param dict tickfont: axis tick font style.
57+
:param str ticks: ticks style.
58+
:param float tickwidth: width of ticks.
59+
:param bool showgrid: show or hide axis grid.
60+
:param bool showline: show or hide axis.
61+
:param bool zeroline: show or hide zero line.
62+
:param str zerolinecolor: color of zero line.
63+
:param float zerolinewidth: width of zero line.
64+
:param bool mirror: mirror axis.
65+
:param float linewidth: width of axis line.
66+
:param str linecolor: color of axis line.
6767
"""
6868

6969
energy_axis_style_dict = {
@@ -82,20 +82,20 @@
8282
}
8383

8484
"""
85-
Energy axis style.
86-
87-
:param dict titlefont: axis title font style.
88-
:param dict tickfont: axis tick font style.
89-
:param str ticks: ticks style.
90-
:param float tickwidth: width of ticks.
91-
:param bool showgrid: show or hide axis grid.
92-
:param bool showline: show or hide axis.
93-
:param bool zeroline: show or hide zero line.
94-
:param str zerolinecolor: color of zero line.
95-
:param float zerolinewidth: width of zero line.
96-
:param bool mirror: mirror axis.
97-
:param float linewidth: width of axis line.
98-
:param str linecolor: color of axis line.
85+
Energy axis style.
86+
87+
:param dict titlefont: axis title font style.
88+
:param dict tickfont: axis tick font style.
89+
:param str ticks: ticks style.
90+
:param float tickwidth: width of ticks.
91+
:param bool showgrid: show or hide axis grid.
92+
:param bool showline: show or hide axis.
93+
:param bool zeroline: show or hide zero line.
94+
:param str zerolinecolor: color of zero line.
95+
:param float zerolinewidth: width of zero line.
96+
:param bool mirror: mirror axis.
97+
:param float linewidth: width of axis line.
98+
:param str linecolor: color of axis line.
9999
"""
100100

101101
spin_up_trace_style_dict = {
@@ -105,11 +105,11 @@
105105
}
106106

107107
"""
108-
Line style for Spin.up traces.
108+
Line style for Spin.up traces.
109109
110-
:param dict line: Line style dictionary.
111-
:param str mode: Plotly mode.
112-
:param str visible: Trace visibility.
110+
:param dict line: Line style dictionary.
111+
:param str mode: Plotly mode.
112+
:param str visible: Trace visibility.
113113
"""
114114

115115
spin_down_trace_style_dict = {
@@ -119,11 +119,11 @@
119119
}
120120

121121
"""
122-
Line style for Spin.down traces.
122+
Line style for Spin.down traces.
123123
124-
:param dict line: Line style dictionary.
125-
:param str mode: Plotly mode.
126-
:param str visible: Trace visibility.
124+
:param dict line: Line style dictionary.
125+
:param str mode: Plotly mode.
126+
:param str visible: Trace visibility.
127127
"""
128128

129129
legend_style_dict = {
@@ -133,9 +133,9 @@
133133
}
134134

135135
"""
136-
Legend style.
136+
Legend style.
137137
138-
:param str bordercolor: border color of legend.
139-
:param int borderwidth: width of border.
140-
:param str traceorder: order of trace.
138+
:param str bordercolor: border color of legend.
139+
:param int borderwidth: width of border.
140+
:param str traceorder: order of trace.
141141
"""

Diff for: tests/cli/test_cli.py

+6
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,8 @@ def test_calc_quality_summary_nacl(self, tmp_path):
357357
"description-quality",
358358
"--potcar-symbols",
359359
"Na_pv Cl",
360+
"--file-doscar",
361+
"DOSCAR.LSO.lobster",
360362
"--bvacomp",
361363
"--doscomp",
362364
"--erange",
@@ -591,6 +593,8 @@ def test_cli_exceptions(self):
591593
args = [
592594
"description-quality",
593595
"--doscomp",
596+
"-fdos",
597+
"DOSCAR.LSO.lobster",
594598
]
595599

596600
test = get_parser().parse_args(args)
@@ -602,6 +606,8 @@ def test_cli_exceptions(self):
602606
os.chdir(TestDir / "test_data/CsH")
603607
args = [
604608
"plot-dos",
609+
"-fdos",
610+
"DOSCAR.LSO.lobster",
605611
]
606612

607613
test = get_parser().parse_args(args)

0 commit comments

Comments
 (0)