From d635cebad46c2705ed953e16d76023755f2d83f7 Mon Sep 17 00:00:00 2001 From: Ivan Carvalho Date: Tue, 30 Apr 2024 08:11:07 -0400 Subject: [PATCH 1/2] Allow partial kwargs in mpl_draw --- rustworkx/visualization/matplotlib.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rustworkx/visualization/matplotlib.pyi b/rustworkx/visualization/matplotlib.pyi index c4ab0e71a..3c5625d7f 100644 --- a/rustworkx/visualization/matplotlib.pyi +++ b/rustworkx/visualization/matplotlib.pyi @@ -20,7 +20,7 @@ if typing.TYPE_CHECKING: _S = typing.TypeVar("_S") _T = typing.TypeVar("_T") -class _DrawKwargs(typing.TypedDict): +class _DrawKwargs(typing.TypedDict, total=False): arrowstyle: str arrow_size: int node_list: list[int] From b6e6471ce8ce80e45beda089a78638ce32e3c587 Mon Sep 17 00:00:00 2001 From: Ivan Carvalho Date: Tue, 30 Apr 2024 08:15:49 -0400 Subject: [PATCH 2/2] Add release note as well --- .../notes/fix-mpl-draw-kargs-typing-6cf7cfde0db072d5.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 releasenotes/notes/fix-mpl-draw-kargs-typing-6cf7cfde0db072d5.yaml diff --git a/releasenotes/notes/fix-mpl-draw-kargs-typing-6cf7cfde0db072d5.yaml b/releasenotes/notes/fix-mpl-draw-kargs-typing-6cf7cfde0db072d5.yaml new file mode 100644 index 000000000..f483d5d37 --- /dev/null +++ b/releasenotes/notes/fix-mpl-draw-kargs-typing-6cf7cfde0db072d5.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixed a bug in the type hint for the :func:`~rustworkx.visualization.mpl_draw`. + Previously, all `kwargs` were required when calling the method. The new annotation + accepts `kwargs` with partial arguments. \ No newline at end of file