Skip to content

Commit f1c0c09

Browse files
committed
future annotations
1 parent c8c3f9e commit f1c0c09

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

src/tikzplotlib/_save.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
from __future__ import annotations
2+
13
import enum
24
import pathlib
35
import tempfile
46
import warnings
5-
from typing import List, Optional, Set, Union
67

78
import matplotlib as mpl
89
import matplotlib.pyplot as plt
@@ -17,22 +18,22 @@
1718

1819
def get_tikz_code(
1920
figure="gcf",
20-
filepath: Optional[Union[str, pathlib.Path]] = None,
21-
axis_width: Optional[str] = None,
22-
axis_height: Optional[str] = None,
21+
filepath: str | pathlib.Path | None = None,
22+
axis_width: str | None = None,
23+
axis_height: str | None = None,
2324
textsize: float = 10.0,
24-
tex_relative_path_to_data: Optional[str] = None,
25+
tex_relative_path_to_data: str | None = None,
2526
externalize_tables: bool = False,
2627
override_externals: bool = False,
27-
externals_search_path: Optional[str] = None,
28+
externals_search_path: str | None = None,
2829
strict: bool = False,
2930
wrap: bool = True,
3031
add_axis_environment: bool = True,
31-
extra_axis_parameters: Optional[Union[List, Set]] = None,
32+
extra_axis_parameters: list | set | None = None,
3233
extra_groupstyle_parameters: dict = {},
33-
extra_tikzpicture_parameters: Optional[Union[List, Set]] = None,
34-
extra_lines_start: Optional[Union[List, Set]] = None,
35-
dpi: Optional[int] = None,
34+
extra_tikzpicture_parameters: list | set | None = None,
35+
extra_lines_start: list | set | None = None,
36+
dpi: int | None = None,
3637
show_info: bool = False,
3738
include_disclaimer: bool = True,
3839
standalone: bool = False,
@@ -246,9 +247,7 @@ def get_tikz_code(
246247
return code
247248

248249

249-
def save(
250-
filepath: Union[str, pathlib.Path], *args, encoding: Optional[str] = None, **kwargs
251-
):
250+
def save(filepath: str | pathlib.Path, *args, encoding: str | None = None, **kwargs):
252251
"""Same as `get_tikz_code()`, but actually saves the code to a file.
253252
254253
:param filepath: The file to which the TikZ output will be written.

0 commit comments

Comments
 (0)