Skip to content
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

Add extra methods to PyDAG class #9

Merged
merged 3 commits into from
Jan 27, 2020
Merged

Add extra methods to PyDAG class #9

merged 3 commits into from
Jan 27, 2020

Conversation

mtreinish
Copy link
Member

This commit adds 3 new methods to the PyDAG class to add equivalent
functionality to some networkx methods. The first two are in_edges and
out_edges. These functions are basically the same as adj_direction
except it's split by direction and also changes the output format to
be a list of tuples with node indexes and edge data. This way one can
reproduce/recreate the edges in the graph easily. The third method is
out_degree, which is the missing dual of in_degree but for the other
direction.

This commit adds 3 new methods to the PyDAG class to add equivalent
functionality to some networkx methods. The first two are in_edges and
out_edges. These functions are basically the same as adj_direction
except it's split by direction and also changes the output format to
be a list of tuples with node indexes and edge data. This way one can
reproduce/recreate the edges in the graph easily. The third method is
out_degree, which is the missing dual of in_degree but for the other
direction.
This commit adds 2 more method implementations to the PyDAG class. First
it adds support for calling len() on PyDAG objects which will return the
number of nodes in the graph. The second is a new method get_node_data()
which will return the object stored for a node at a given index.
This commit updates the documentation to reflect the current state of
the repo. First it adds a definition for __len__() which was missing
from the previous commit. Additionally, it fixes the class preamble to
not mention daggy anymore since that's not used. It also removes the bit
about indexes changing on removal since the use of StableGraph
internally has removed that limitation. It now only mentions that nodes
and edges are indexed with integers instead of using the data/weight.
@mtreinish mtreinish merged commit 29418f7 into master Jan 27, 2020
@mtreinish mtreinish deleted the in_out_edges_method branch January 27, 2020 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant