File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,7 +44,8 @@ async def _main():
4444 headless = args .headless ,
4545 timeout = args .timeout ,
4646 ) as k :
47- return await k .write_fig_from_object (
47+ # pyright doesn't understand bool = Literal[True] | Literal[False]
48+ return await k .write_fig_from_object ( # type: ignore[reportCallIssue]
4849 _utils .load_figures_from_paths (paths ),
4950 stepper = args .stepper ,
5051 cancel_on_error = args .fail_fast ,
Original file line number Diff line number Diff line change 1010from ._args import args
1111
1212if TYPE_CHECKING :
13- ...
13+ from typing import Generator
14+
15+ from kaleido ._utils .fig_tools import LayoutOpts
16+ from kaleido .kaleido import FigureDict
1417
1518_logger = logistro .getLogger (__name__ )
1619
@@ -35,7 +38,7 @@ class Param(TypedDict):
3538
3639
3740# maybe don't have this do params and figures
38- def load_figures_from_paths (paths : list [Path ]):
41+ def load_figures_from_paths (paths : list [Path ]) -> Generator [ FigureDict , None ] :
3942 # Set json
4043 for path in paths :
4144 if not path .is_file ():
@@ -54,7 +57,7 @@ def load_figures_from_paths(paths: list[Path]):
5457 if not args .parameterize
5558 else f"{ path .stem !s} -{ w !s} x{ h !s} @{ s !s} .{ f !s} "
5659 )
57- opts = {
60+ opts : LayoutOpts = {
5861 "scale" : s ,
5962 "width" : w ,
6063 "height" : h ,
@@ -65,3 +68,6 @@ def load_figures_from_paths(paths: list[Path]):
6568 "path" : str (Path (args .output ) / name ),
6669 "opts" : opts ,
6770 }
71+
72+ class FigureDict (TypedDict ):
73+ """The type a fig_dicts returns for `write_fig_from_object`."""
You can’t perform that action at this time.
0 commit comments