Check type hinting on layouts is accurate
The type hints for the automatic layout were created to look only at undirected graphs, but now we're automatically converting directed into undirected.
Since we're supporting a greater range of graphs now, we should review and adjust any type hints that may not be strictly accurate.
could you provide some more insight on this? @daxpryce
Sure!
When we added autolayouts, it was narrowly tailored to one very specific use case and entry point; start with a file, end up with a layout, optionally with a rendering of said layout.
The work @dlee0156 has done on autolayouts is to make it more robust and use the functions as compositional elements in your own chain.
However, when we wrote it, all the type hints were expecting, specifically, an nx.Graph type - and now we're supporting nx.Graph, nx.DiGraph, nx.OrderedGraph, and nx.OrderedDiGraph. I'm fairly certain our functions aren't actually type hinted to say all of those types (which is probably fine in the sense that an OrderedGraph or a DiGraph are technically subclasses of nx.Graph, but I want us to be explicit about those sets because when we get an nx.MultiGraph (edit: which is also a subclass of nx.Graph), we do balk and kick it back out. So if we explicitly list the exact types we support, we're not signalling that we accept more than we actually do.
Since mypy is fine with it I didn't want to hold up her changes, and I also wanted to use the opportunity to use beartype to typecheck for us while we did it as we slowly rely on it for our typecheck preconditions vs. manually doing it.
I will be needing some assistance in this @daxpryce and could you tell me your email had to discuss something with you