Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinsulzer committed Feb 27, 2024
1 parent 6ccf362 commit d28e937
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pybamm/plotting/dynamic_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ def dynamic_plot(*args, **kwargs):
"""
Creates a :class:`pybamm.QuickPlot` object (with arguments 'args' and keyword
arguments 'kwargs') and then calls :meth:`pybamm.QuickPlot.dynamic_plot`.
The key-word argument 'testing' is passed to the 'dynamic_plot' method, not the
The key-word argument 'show_plot' is passed to the 'dynamic_plot' method, not the
`QuickPlot` class.
Returns
-------
plot : :class:`pybamm.QuickPlot`
The 'QuickPlot' object that was created
"""
kwargs_for_class = {k: v for k, v in kwargs.items() if k != "testing"}
kwargs_for_class = {k: v for k, v in kwargs.items() if k != "show_plot"}
plot = pybamm.QuickPlot(*args, **kwargs_for_class)
plot.dynamic_plot(kwargs.get("testing", False))
plot.dynamic_plot(kwargs.get("show_plot", True))
return plot
4 changes: 2 additions & 2 deletions pybamm/plotting/plot_voltage_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def plot_voltage_components(

if ax is not None:
fig = None
testing = True
show_plot = False
else:
fig, ax = plt.subplots(figsize=(8, 4))

Expand Down Expand Up @@ -152,7 +152,7 @@ def plot_voltage_components(
)
ax.set_ylim([y_min, y_max])

if not testing: # pragma: no cover
if show_plot: # pragma: no cover
plt.show()

return fig, ax

0 comments on commit d28e937

Please sign in to comment.