Is your feature request related to a problem? Please describe if so!
Not a problem but it would be nice if users could SEE the graph they created just to make sure they created it right.
Describe the feature you'd like!
As we discussed, implement a `draw_graph' method of DAG so that users can see if they created the thing they wanted to.
End-stage behavior:
users can call Graph.draw_graph() and it will draw a graph and return a matplotlib object for customization.
Here, the desired behavior is that we have nodes labeled a1 and a2 and edges from a1 to a2.
List Method
For the list method, it is not as obvious how this should be implemented since Agents don't really have a "name". But let's just make the name the index of the Agent (and maybe we say in docs we recommend dict method)
Here, the desired behavior is that we have nodes labeled 0 and 1 and edges from 0 to 1.
Dependency update
[ ] Add networkx and matplotlib as dependencies. Bound between major versions of what they are currently on. So for example, if networkx is 2.1 then let's require Networkx between 2.1 and 3
Mainly, we need to validate that we are constructing the nx graph correctly. Because a graph has two components (nodes and vertices), I'd check each one. So first just make sure the nodes have the correct names, then verify each edge
Let's also verify we are returning a matplotlib object
Documentation
[ ] Update the docstrings for the dag class
[ ] Give example of using this in the tutorial...the file is tutorials_4_graph.rst
Optional enhancements
always good when things look pretty, my first stab (in the graph branch) was ok but can be improved on :)
Is your feature request related to a problem? Please describe if so! Not a problem but it would be nice if users could SEE the graph they created just to make sure they created it right.
Describe the feature you'd like! As we discussed, implement a `draw_graph' method of DAG so that users can see if they created the thing they wanted to.
End-stage behavior:
Graph.draw_graph()
and it will draw a graph and return a matplotlib object for customization.I started this awhile back here (https://github.com/josh-ashkinaze/plurals/blob/7370a4bc8c62bdee5634b16e784c5cc5a38c7438/plurals/deliberation.py#L764)
Implementation
Drawing stuff
Labels
Dict method
Here, the desired behavior is that we have nodes labeled
a1
anda2
and edges froma1
toa2
.List Method
Here, the desired behavior is that we have nodes labeled
0
and1
and edges from0
to1
.Dependency update
[1] https://networkx.org/documentation/stable/reference/generated/networkx.drawing.nx_pylab.draw_networkx.html#networkx.drawing.nx_pylab.draw_networkx
Unit tests
Documentation
Optional enhancements