Skip to content

Commit 66ecff7

Browse files
committed
_helpers.saveplot: more accurate signature
1 parent c0aadf2 commit 66ecff7

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

stagpy/_helpers.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ def scilabel(value: float, precision: int = 2) -> str:
6969

7070

7171
def saveplot(
72-
fig: Figure, *name_args: Any, close: bool = True, **name_kwargs: Any
72+
fig: Figure,
73+
stem: str,
74+
timestep: Optional[int] = None,
75+
close: bool = True,
7376
) -> None:
7477
"""Save matplotlib figure.
7578
@@ -78,11 +81,11 @@ def saveplot(
7881
7982
Args:
8083
fig: the :class:`matplotlib.figure.Figure` to save.
84+
stem: short description of file content.
85+
timestep: timestep if relevant.
8186
close: whether to close the figure.
82-
name_args: positional arguments passed on to :func:`out_name`.
83-
name_kwargs: keyword arguments passed on to :func:`out_name`.
8487
"""
85-
oname = out_name(*name_args, **name_kwargs)
88+
oname = out_name(stem, timestep)
8689
fig.savefig(
8790
f"{oname}.{conf.plot.format}", format=conf.plot.format, bbox_inches="tight"
8891
)

0 commit comments

Comments
 (0)