Skip to content

Commit a037424

Browse files
committed
Merge branch 'enhance-visualization-typing' of github.com:zen-xu/rustworkx into enhance-visualization-typing
2 parents 0fe0781 + 128b439 commit a037424

File tree

1 file changed

+26
-6
lines changed

1 file changed

+26
-6
lines changed

rustworkx/rustworkx.pyi

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,7 @@ class PyGraph(Generic[_S, _T]):
12401240
/,
12411241
weight_combo_fn: Callable[[_T, _T], _T] | None = ...,
12421242
) -> int: ...
1243-
def copy(self) -> PyGraph[_S, _T]: ...
1243+
def copy(self) -> Self: ...
12441244
def degree(self, node: int, /) -> int: ...
12451245
def edge_index_map(self) -> EdgeIndexMap[_T]: ...
12461246
def edge_indices(self) -> EdgeIndices: ...
@@ -1314,14 +1314,24 @@ class PyGraph(Generic[_S, _T]):
13141314
node_filter: Callable[[_S], bool] | None = ...,
13151315
edge_weight_map: Callable[[_T], _T] | None = ...,
13161316
) -> NodeMap: ...
1317+
@overload
13171318
def to_dot(
13181319
self,
13191320
/,
13201321
node_attr: Callable[[_S], dict[str, str]] | None = ...,
13211322
edge_attr: Callable[[_T], dict[str, str]] | None = ...,
13221323
graph_attr: dict[str, str] | None = ...,
1323-
filename: str | None = None,
1324-
) -> str | None: ...
1324+
filename: None = ...,
1325+
) -> str: ...
1326+
@overload
1327+
def to_dot(
1328+
self,
1329+
/,
1330+
node_attr: Callable[[_S], dict[str, str]] | None = ...,
1331+
edge_attr: Callable[[_T], dict[str, str]] | None = ...,
1332+
graph_attr: dict[str, str] | None = ...,
1333+
filename: str = ...,
1334+
) -> None: ...
13251335
def to_directed(self) -> PyDiGraph[_S, _T]: ...
13261336
def update_edge(
13271337
self,
@@ -1398,7 +1408,7 @@ class PyDiGraph(Generic[_S, _T]):
13981408
check_cycle: bool | None = ...,
13991409
weight_combo_fn: Callable[[_T, _T], _T] | None = ...,
14001410
) -> int: ...
1401-
def copy(self) -> PyDiGraph[_S, _T]: ...
1411+
def copy(self) -> Self: ...
14021412
def edge_index_map(self) -> EdgeIndexMap[_T]: ...
14031413
def edge_indices(self) -> EdgeIndices: ...
14041414
def edge_indices_from_endpoints(self, node_a: int, node_b: int) -> EdgeIndices: ...
@@ -1514,14 +1524,24 @@ class PyDiGraph(Generic[_S, _T]):
15141524
) -> NodeMap: ...
15151525
def successor_indices(self, node: int, /) -> NodeIndices: ...
15161526
def successors(self, node: int, /) -> list[_S]: ...
1527+
@overload
15171528
def to_dot(
15181529
self,
15191530
/,
15201531
node_attr: Callable[[_S], dict[str, str]] | None = ...,
15211532
edge_attr: Callable[[_T], dict[str, str]] | None = ...,
15221533
graph_attr: dict[str, str] | None = ...,
1523-
filename: str | None = None,
1524-
) -> str | None: ...
1534+
filename: None = ...,
1535+
) -> str: ...
1536+
@overload
1537+
def to_dot(
1538+
self,
1539+
/,
1540+
node_attr: Callable[[_S], dict[str, str]] | None = ...,
1541+
edge_attr: Callable[[_T], dict[str, str]] | None = ...,
1542+
graph_attr: dict[str, str] | None = ...,
1543+
filename: str = ...,
1544+
) -> None: ...
15251545
def to_undirected(
15261546
self,
15271547
/,

0 commit comments

Comments
 (0)