Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions stubs/networkx/networkx/drawing/nx_agraph.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,14 @@ class _SupportsOpen(Protocol[_ModeT_contra, _FileT_co]):

@_dispatchable
def from_agraph(
A: AGraph, create_using: Graph[_Node] | type[Graph[_Node]] | None = None
) -> Graph[_Node]: ... # type of node cannot be known statically
A: AGraph, create_using: Graph[str] | type[Graph[str]] | None = None # TODO: add overloads on `create_using`
) -> Graph[str]: ...
def to_agraph(N: Graph[_Node]) -> AGraph: ...
def write_dot(
G: Graph[_Node], path: str | IO[str] | IO[bytes] | _SupportsOpen[OpenTextModeWriting, IO[str] | IO[bytes]]
) -> None: ...
@_dispatchable
def read_dot(
path: str | IO[str] | IO[bytes] | _SupportsOpen[OpenTextModeReading, IO[str] | IO[bytes]],
) -> Graph[Any]: ... # type of node cannot be known statically
def read_dot(path: str | IO[str] | IO[bytes] | _SupportsOpen[OpenTextModeReading, IO[str] | IO[bytes]]) -> Graph[str]: ...
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like graphs read from dot have string nodes

def graphviz_layout(
G: Graph[_Node], prog: str = "neato", root: str | None = None, args: str = ""
) -> dict[_Node, tuple[float, float]]: ...
Expand Down
6 changes: 3 additions & 3 deletions stubs/networkx/networkx/drawing/nx_pydot.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def write_dot(G: Graph[_Node], path: str | PathLike[Any] | SupportsWrite[str]) -
@_dispatchable
def read_dot(path: str | PathLike[Any] | SupportsRead[str]) -> Graph[str]: ...
@_dispatchable
def from_pydot(P: Dot): ...
def from_pydot(P: Dot) -> Graph[str]: ...
def to_pydot(N: Graph[_Node]) -> Dot: ...
def graphviz_layout(G: Graph[_Node], prog: str = "neato", root: _Node | None = None): ...
def pydot_layout(G: Graph[_Node], prog: str = "neato", root: _Node | None = None): ...
def graphviz_layout(G: Graph[_Node], prog: str = "neato", root: _Node | None = None) -> dict[_Node, tuple[float, float]]: ...
def pydot_layout(G: Graph[_Node], prog: str = "neato", root: _Node | None = None) -> dict[_Node, tuple[float, float]]: ...
Loading