|
12 | 12 | import subprocess |
13 | 13 | import tempfile |
14 | 14 | import re |
| 15 | +from typing import TYPE_CHECKING |
| 16 | + |
| 17 | +if TYPE_CHECKING: |
| 18 | + import pygambit |
15 | 19 |
|
16 | 20 | from pathlib import Path |
17 | 21 | from typing import List, Optional |
@@ -1254,14 +1258,14 @@ def ef_to_tex(ef_file: str, scale_factor: float = 0.8, show_grid: bool = False) |
1254 | 1258 | grid = original_grid |
1255 | 1259 |
|
1256 | 1260 | def generate_tikz( |
1257 | | - game, |
1258 | | - save_to: Optional[str] = None, |
1259 | | - scale_factor: float = 0.8, |
1260 | | - level_spacing: int = 6, |
1261 | | - sublevel_spacing: int = 2, |
1262 | | - width_spacing: int = 2, |
1263 | | - show_grid: bool = False |
1264 | | - ) -> str: |
| 1261 | + game: str | "pygambit.gambit.Game", |
| 1262 | + save_to: Optional[str] = None, |
| 1263 | + scale_factor: float = 0.8, |
| 1264 | + level_spacing: int = 6, |
| 1265 | + sublevel_spacing: int = 2, |
| 1266 | + width_spacing: int = 2, |
| 1267 | + show_grid: bool = False, |
| 1268 | +) -> str: |
1265 | 1269 | """ |
1266 | 1270 | Generate complete TikZ code from an extensive form (.ef) file. |
1267 | 1271 |
|
@@ -1350,7 +1354,7 @@ def generate_tikz( |
1350 | 1354 |
|
1351 | 1355 |
|
1352 | 1356 | def draw_tree( |
1353 | | - game, |
| 1357 | + game: str | "pygambit.gambit.Game", |
1354 | 1358 | save_to: Optional[str] = None, |
1355 | 1359 | scale_factor: float = 0.8, |
1356 | 1360 | level_spacing: int = 6, |
|
0 commit comments