Skip to content

Commit

Permalink
Merge pull request #369 from naik-aakash/update_plotly_test_data
Browse files Browse the repository at this point in the history
Update plotly test data
  • Loading branch information
JaGeo authored Feb 4, 2025
2 parents 6c7b8c5 + 851a9e8 commit bdf186b
Show file tree
Hide file tree
Showing 11 changed files with 257,810 additions and 27 deletions.
12 changes: 6 additions & 6 deletions src/lobsterpy/plotting/layout_dicts.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"""

layout_dict = {
"titlefont": {"size": 18},
"title.font": {"size": 18},
"showlegend": True,
"title_x": 0.1,
"title_y": 0.9,
Expand All @@ -25,7 +25,7 @@
"""
General layout of Plotly figure.
:param dict titlefont: Line style dictionary.
:param dict title.font: 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.
Expand All @@ -35,7 +35,7 @@
"""

cohp_axis_style_dict = {
"titlefont": {"size": 20},
"title.font": {"size": 20},
"tickfont": {"size": 16},
"ticks": "inside",
"tickwidth": 2,
Expand All @@ -52,7 +52,7 @@
"""
COXX axis style.
:param dict titlefont: axis title font style.
:param dict title.font: axis title font style.
:param dict tickfont: axis tick font style.
:param str ticks: ticks style.
:param float tickwidth: width of ticks.
Expand All @@ -67,7 +67,7 @@
"""

energy_axis_style_dict = {
"titlefont": {"size": 20},
"title.font": {"size": 20},
"tickfont": {"size": 16},
"ticks": "inside",
"tickwidth": 2,
Expand All @@ -84,7 +84,7 @@
"""
Energy axis style.
:param dict titlefont: axis title font style.
:param dict title.font: axis title font style.
:param dict tickfont: axis tick font style.
:param str ticks: ticks style.
:param float tickwidth: width of ticks.
Expand Down
25 changes: 13 additions & 12 deletions tests/plotting/test_plotting.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import base64
from pathlib import Path

import numpy as np
Expand Down Expand Up @@ -47,7 +48,7 @@ def test_add_all_relevant_cohps_nacl(self, plot_analyse_nacl):
og_visible.append(og_trace.visible)
ref_visible.append(ref_trace.visible)
og_x.append(list(og_trace.x))
ref_x.append(list(ref_trace.x))
ref_x.append(list(np.frombuffer(base64.b64decode(ref_trace.x["bdata"]), dtype=np.float64)))
og_y.append(list(og_trace.y))
ref_y.append(list(ref_trace.y))

Expand Down Expand Up @@ -89,9 +90,9 @@ def test_add_all_relevant_cohps_nacl_cobi_orb(self, plot_analyse_nacl_cobi_orb):
og_visible.append(og_trace.visible)
ref_visible.append(ref_trace.visible)
og_x.append(list(og_trace.x))
ref_x.append(list(ref_trace.x))
ref_x.append(list(np.frombuffer(base64.b64decode(ref_trace.x["bdata"]), dtype=np.float64)))
og_y.append(og_trace.y.tolist())
ref_y.append(list(ref_trace.y))
ref_y.append(list(np.frombuffer(base64.b64decode(ref_trace.y["bdata"]), dtype=np.float64)))

assert sorted(og_name) == sorted(ref_name)
assert og_line == ref_line
Expand Down Expand Up @@ -132,7 +133,7 @@ def test_add_all_relevant_cohps_batio3_orb(self, plot_analyse_batio3_orb):
og_x.append(list(og_trace.x))
ref_x.append(list(ref_trace.x))
og_y.append(og_trace.y.tolist())
ref_y.append(list(ref_trace.y))
ref_y.append(list(np.frombuffer(base64.b64decode(ref_trace.y["bdata"]), dtype=np.float64)))

assert sorted(og_name) == sorted(ref_name)
assert og_line == ref_line
Expand Down Expand Up @@ -172,7 +173,7 @@ def test_add_all_relevant_cohps_cdf(self, plot_analyse_cdf_orb):
og_x.append(list(og_trace.x))
ref_x.append(list(ref_trace.x))
og_y.append(og_trace.y.tolist())
ref_y.append(list(ref_trace.y))
ref_y.append(list(np.frombuffer(base64.b64decode(ref_trace.y["bdata"]), dtype=np.float64)))

assert sorted(og_name) == sorted(ref_name)
assert og_line == ref_line
Expand Down Expand Up @@ -207,9 +208,9 @@ def test_add_all_relevant_cohps_nacl_cobi(self, plot_analyse_nacl_cobi):
og_visible.append(og_trace.visible)
ref_visible.append(ref_trace.visible)
og_x.append(list(og_trace.x))
ref_x.append(list(ref_trace.x))
ref_x.append(list(np.frombuffer(base64.b64decode(ref_trace.x["bdata"]), dtype=np.float64)))
og_y.append(og_trace.y.tolist())
ref_y.append(list(ref_trace.y))
ref_y.append(list(np.frombuffer(base64.b64decode(ref_trace.y["bdata"]), dtype=np.float64)))

assert sorted(og_name) == sorted(ref_name)
assert og_line == ref_line
Expand Down Expand Up @@ -250,9 +251,9 @@ def test_add_all_relevant_cohps_k3sb(self, plot_analyse_k3sb):
og_visible.append(og_trace.visible)
ref_visible.append(ref_trace.visible)
og_x.append(list(og_trace.x))
ref_x.append(list(ref_trace.x))
ref_x.append(list(np.frombuffer(base64.b64decode(ref_trace.x["bdata"]), dtype=np.float64)))
og_y.append(og_trace.y.tolist())
ref_y.append(list(ref_trace.y))
ref_y.append(list(np.frombuffer(base64.b64decode(ref_trace.y["bdata"]), dtype=np.float64)))

assert sorted(og_name) == sorted(ref_name)
assert og_line == ref_line
Expand Down Expand Up @@ -288,7 +289,7 @@ def test_add_cohps_by_lobster_label_nacl(self, plot_analyse_nacl):
og_x.append(list(og_trace.x))
ref_x.append(list(ref_trace.x))
og_y.append(og_trace.y.tolist())
ref_y.append(list(ref_trace.y))
ref_y.append(list(np.frombuffer(base64.b64decode(ref_trace.y["bdata"]), dtype=np.float64)))

assert sorted(og_name) == sorted(ref_name)
assert og_line == ref_line
Expand Down Expand Up @@ -321,7 +322,7 @@ def test_add_cohps_from_plot_data(self, plot_analyse_nasi):
og_x.append(list(og_trace.x))
ref_x.append(list(ref_trace.x))
og_y.append(og_trace.y.tolist())
ref_y.append(list(ref_trace.y))
ref_y.append(list(np.frombuffer(base64.b64decode(ref_trace.y["bdata"]), dtype=np.float64)))

assert sorted(og_name) == sorted(ref_name)
assert og_line == ref_line
Expand Down Expand Up @@ -359,7 +360,7 @@ def test_add_cohps_from_plot_data_json(self, lobsterpy_plot_data):
og_x.append(list(og_trace.x))
ref_x.append(list(ref_trace.x))
og_y.append(og_trace.y.tolist())
ref_y.append(list(ref_trace.y))
ref_y.append(list(np.frombuffer(base64.b64decode(ref_trace.y["bdata"]), dtype=np.float64)))

assert sorted(og_name) == sorted(ref_name)
assert og_line == ref_line
Expand Down
71,143 changes: 71,142 additions & 1 deletion tests/test_data/interactive_plotter_ref/analyse_BaTiO3_orb_label_resol.json
100644 → 100755

Large diffs are not rendered by default.

72,751 changes: 72,750 additions & 1 deletion tests/test_data/interactive_plotter_ref/analyse_CdF_orb_resol.json

Large diffs are not rendered by default.

4,853 changes: 4,852 additions & 1 deletion tests/test_data/interactive_plotter_ref/analyse_K3Sb.json

Large diffs are not rendered by default.

1,262 changes: 1,261 additions & 1 deletion tests/test_data/interactive_plotter_ref/analyse_NaCl.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1,325 changes: 1,324 additions & 1 deletion tests/test_data/interactive_plotter_ref/analyse_NaCl_cobi_orb_res.json
100644 → 100755

Large diffs are not rendered by default.

2,096 changes: 2,095 additions & 1 deletion tests/test_data/interactive_plotter_ref/analyse_NaCl_label.json

Large diffs are not rendered by default.

3,348 changes: 3,347 additions & 1 deletion tests/test_data/interactive_plotter_ref/analyse_NaSi.json

Large diffs are not rendered by default.

101,020 changes: 101,019 additions & 1 deletion tests/test_data/interactive_plotter_ref/fig_mp8818.json

Large diffs are not rendered by default.

0 comments on commit bdf186b

Please sign in to comment.