question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Networkx provides many great tools for inspection, analysis, and manipulation of graphs. It might be nice to be able to use these tools when working with streamz.

Use Cases: UC1:

  1. User1 writes a graph (graph1) to perform some analysis
  2. User2 would like to extend this analysis so they write a new pipeline (graph2) with dummy parent nodes with the same name as the nodes from graph1.
  3. User2 then uses graph3 = nx.compose(graph2, graph1). Graph3 has nodes from both graphs allowing the graphs themselves to be built modularly.

UC2:

  1. User3 suspects something went wrong in the compose step because of a name mismatch. User3 uses [f for f in graph3 if nx.predecessors(f) ==0] to find all the nodes with no parents. User3 then looks through the list and finds a node who’s name didn’t match and thus was not linked properly.

I think this can be done via a subclass of nx.DiGraph with select methods overridden, namely:

  1. add_node which now needs to take in a node class, args and kwargs and a name
  2. add_edge which now need to take in either
    1. two node classes with args and kwargs (producing two new nodes)
    2. a node class with args and kwargs and a name
    3. two names
  3. add_edge_from so compose works properly.

Most of the overrides either need to init new nodes or provide connections between nodes.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
OpenCoderXcommented, Aug 2, 2018

Probably I could share some obfuscated snippets, let me check with my leadership.

1reaction
martindurantcommented, Jul 31, 2018

@opensourcechris , I’m sure the authors would be very appreciative to hear of your use case and possibly even code, in as far as you are able to share!

Read more comments on GitHub >

github_iconTop Results From Across the Web

NetworkX extensibility for custom storage of nodes/edges
It should be possible to extend networkx by subclassing the Graph class and providing user-defined factories functions. Those functions could query a ...
Read more >
Welcome to extended-networkx-tools's documentation ...
Function to retrieve convergence rate based on an alternate approach. ... Creates a neighbour matrix for a specified graph: g, each row represents...
Read more >
node_expansion — NetworkX 2.8.8 documentation
The node expansion is the quotient of the size of the node boundary of S and the cardinality of S. [1]. Parameters: GNetworkX...
Read more >
API Documentation - NetworkX
The XGraph and XDiGraph classes extend the Graph and DiGraph classes by allowing (optional) self loops, multiedges and by decorating each edge with...
Read more >
spring_layout — NetworkX 2.8.8 documentation
Increase this value to move nodes farther apart. posdict or None optional (default=None). Initial positions for nodes as a dictionary with node as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found