Skip to content

Commit

Permalink
Merge pull request #321 from naik-aakash/update_doc
Browse files Browse the repository at this point in the history
Fix unexpected "DOSCAR.LSO.lobster" exception in cli
  • Loading branch information
JaGeo committed Jul 31, 2024
2 parents 64d35d9 + 4ea7de1 commit e66e1de
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 50 deletions.
2 changes: 1 addition & 1 deletion src/lobsterpy/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ def run(args):
)
else:
dos_files = get_file_paths(
path_to_lobster_calc=Path(os.getcwd()), requested_files=["vasprun", "doscar"]
path_to_lobster_calc=Path(os.getcwd()), requested_files=["vasprun", "doscar"], use_lso_dos=False
)
for arg_name in dos_files:
setattr(args, arg_name, dos_files[arg_name])
Expand Down
98 changes: 49 additions & 49 deletions src/lobsterpy/plotting/layout_dicts.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
}

"""
General layout of Plotly figure.
:param dict titlefont: Line style dictionary.
:param bool showlegend: Legend hide or show.
:param float title_x: x axis title size.
:param float title_y: y axis title size.
:param str hovermode: hover behaviour.
:param str paper_bgcolor: background color.
:param str plot_bgcolor: plot background color.
General layout of Plotly figure.
:param dict titlefont: Line style dictionary.
:param bool showlegend: Legend hide or show.
:param float title_x: x axis title size.
:param float title_y: y axis title size.
:param str hovermode: hover behaviour.
:param str paper_bgcolor: background color.
:param str plot_bgcolor: plot background color.
"""

cohp_axis_style_dict = {
Expand All @@ -50,20 +50,20 @@
}

"""
COXX axis style.
:param dict titlefont: axis title font style.
:param dict tickfont: axis tick font style.
:param str ticks: ticks style.
:param float tickwidth: width of ticks.
:param bool showgrid: show or hide axis grid.
:param bool showline: show or hide axis.
:param bool zeroline: show or hide zero line.
:param str zerolinecolor: color of zero line.
:param float zerolinewidth: width of zero line.
:param bool mirror: mirror axis.
:param float linewidth: width of axis line.
:param str linecolor: color of axis line.
COXX axis style.
:param dict titlefont: axis title font style.
:param dict tickfont: axis tick font style.
:param str ticks: ticks style.
:param float tickwidth: width of ticks.
:param bool showgrid: show or hide axis grid.
:param bool showline: show or hide axis.
:param bool zeroline: show or hide zero line.
:param str zerolinecolor: color of zero line.
:param float zerolinewidth: width of zero line.
:param bool mirror: mirror axis.
:param float linewidth: width of axis line.
:param str linecolor: color of axis line.
"""

energy_axis_style_dict = {
Expand All @@ -82,20 +82,20 @@
}

"""
Energy axis style.
:param dict titlefont: axis title font style.
:param dict tickfont: axis tick font style.
:param str ticks: ticks style.
:param float tickwidth: width of ticks.
:param bool showgrid: show or hide axis grid.
:param bool showline: show or hide axis.
:param bool zeroline: show or hide zero line.
:param str zerolinecolor: color of zero line.
:param float zerolinewidth: width of zero line.
:param bool mirror: mirror axis.
:param float linewidth: width of axis line.
:param str linecolor: color of axis line.
Energy axis style.
:param dict titlefont: axis title font style.
:param dict tickfont: axis tick font style.
:param str ticks: ticks style.
:param float tickwidth: width of ticks.
:param bool showgrid: show or hide axis grid.
:param bool showline: show or hide axis.
:param bool zeroline: show or hide zero line.
:param str zerolinecolor: color of zero line.
:param float zerolinewidth: width of zero line.
:param bool mirror: mirror axis.
:param float linewidth: width of axis line.
:param str linecolor: color of axis line.
"""

spin_up_trace_style_dict = {
Expand All @@ -105,11 +105,11 @@
}

"""
Line style for Spin.up traces.
Line style for Spin.up traces.
:param dict line: Line style dictionary.
:param str mode: Plotly mode.
:param str visible: Trace visibility.
:param dict line: Line style dictionary.
:param str mode: Plotly mode.
:param str visible: Trace visibility.
"""

spin_down_trace_style_dict = {
Expand All @@ -119,11 +119,11 @@
}

"""
Line style for Spin.down traces.
Line style for Spin.down traces.
:param dict line: Line style dictionary.
:param str mode: Plotly mode.
:param str visible: Trace visibility.
:param dict line: Line style dictionary.
:param str mode: Plotly mode.
:param str visible: Trace visibility.
"""

legend_style_dict = {
Expand All @@ -133,9 +133,9 @@
}

"""
Legend style.
Legend style.
:param str bordercolor: border color of legend.
:param int borderwidth: width of border.
:param str traceorder: order of trace.
:param str bordercolor: border color of legend.
:param int borderwidth: width of border.
:param str traceorder: order of trace.
"""
6 changes: 6 additions & 0 deletions tests/cli/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,8 @@ def test_calc_quality_summary_nacl(self, tmp_path):
"description-quality",
"--potcar-symbols",
"Na_pv Cl",
"--file-doscar",
"DOSCAR.LSO.lobster",
"--bvacomp",
"--doscomp",
"--erange",
Expand Down Expand Up @@ -591,6 +593,8 @@ def test_cli_exceptions(self):
args = [
"description-quality",
"--doscomp",
"-fdos",
"DOSCAR.LSO.lobster",
]

test = get_parser().parse_args(args)
Expand All @@ -602,6 +606,8 @@ def test_cli_exceptions(self):
os.chdir(TestDir / "test_data/CsH")
args = [
"plot-dos",
"-fdos",
"DOSCAR.LSO.lobster",
]

test = get_parser().parse_args(args)
Expand Down

0 comments on commit e66e1de

Please sign in to comment.