Skip to content

Commit

Permalink
fix test on plot_bar_chart
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaume-vignal committed Oct 4, 2024
1 parent f0f5aee commit 026d41b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/unit_tests/explainer/test_smart_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from shapash.backend import ShapBackend
from shapash.explainer.multi_decorator import MultiDecorator
from shapash.explainer.smart_state import SmartState
from shapash.plots.plot_bar_chart import plot_bar_chart
from shapash.plots.plot_feature_importance import _plot_features_import
from shapash.plots.plot_line_comparison import plot_line_comparison
from shapash.style.style_utils import get_palette
Expand Down Expand Up @@ -661,7 +662,7 @@ def test_plot_bar_chart_1(self):
)
expected_output_fig = go.Figure(data=bars, layout=go.Layout(yaxis=dict(type="category")))
self.smart_explainer._case = "regression"
fig_output = self.smart_explainer.plot._plot_bar_chart("ind", var_dict, x_val, contributions)
fig_output = plot_bar_chart("ind", var_dict, x_val, contributions)
for part in list(zip(fig_output.data, expected_output_fig.data)):
assert part[0].x == part[1].x
assert part[0].y == part[1].y
Expand All @@ -684,7 +685,7 @@ def test_plot_bar_chart_2(self):
expected_output_fig = go.Figure(data=bars, layout=go.Layout(yaxis=dict(type="category")))

self.smart_explainer._case = "regression"
fig_output = self.smart_explainer.plot._plot_bar_chart("ind", var_dict, x_val, contributions)
fig_output = plot_bar_chart("ind", var_dict, x_val, contributions)
for part in list(zip(fig_output.data, expected_output_fig.data)):
assert part[0].x == part[1].x
assert part[0].y == part[1].y
Expand Down

0 comments on commit 026d41b

Please sign in to comment.