-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding vertex plotting option to plot_network #390
Conversation
|
vertices = link.vertices | ||
if include_vertices and vertices: | ||
node_base_name = name + "_vertex_" | ||
link_base_name = name + "_vertexlink_" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vertexlink -> vertex
nx.set_edge_attributes(G, name="base_link", values={(start_node, end_node, link_name): link.name}) | ||
nx.set_node_attributes(G, name="pos", values={end_node: vertices[vertex_ind]}) | ||
nx.set_node_attributes(G, name="type", values={end_node: "Vertex"}) | ||
nx.set_node_attributes(G, name="base_link", values={end_node: link.name}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
base_link -> link_name
@@ -43,7 +43,7 @@ def _format_link_attribute(link_attribute, wn): | |||
|
|||
return link_attribute | |||
|
|||
def plot_network(wn, node_attribute=None, link_attribute=None, title=None, | |||
def plot_network(wn, node_attribute=None, link_attribute=None, title=None, plot_vertices=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plot_vertices -> include_vertices
Closing in favor of #451 |
Provide a summary of the proposed changes, describe tests and documentation, and review the acknowledgement below.
Summary
This PR adds the ability to plot vertices to the
plot_network
function.Tests and documentation
Below are comparisons of the graphics generated in the current tests by plot_network with the same graphics generated with
plot_vertices=True
to verify that the updates don't break current behavior. Note, these don't actually plot any vertices because the involved networks don't have any.:A new test using
io.inp
is added to verify a network that actually have vertices:TODO
Acknowledgement
By contributing to this software project, I acknowledge that I have reviewed the software quality assurance guidelines and that my contributions are submitted under the Revised BSD License.