Skip to content

Conversation

SimonNick
Copy link
Collaborator

I tried to improve the network class a little bit. @IngoScholtes , we should have a look at it when you are back.

  • Nodes do not have the attributes for weights and degree any more. One can use the respective functions degree(), in_degree(), out_degree(), weight(), in_weight(), out_weight().
  • Rewrote add_node(), remove_node(), add_edge() and added the method remove_edge() for a better readability.
  • Use @property for the properties directed, vcount, ecount, weighted, total_edge_weight. This makes also sure that properties like directed cannot easily be changed.
  • Added methods in_edges() and out_edges() which obtain all in- respectively out-edges of a given node.
  • Added methods to_directed() and to_undirected() which convert network into directed / undirected network.
  • Added methods read_nodes() and write_nodes() which read / write node data to a file.
    Rewrote methods read_edges() and write_edges() such that they also read / store edge attributes.

@IngoScholtes
Copy link
Collaborator

Thanks, I will have a look and we can discuss next week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants