-
Notifications
You must be signed in to change notification settings - Fork 148
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
extend networkx #188
Comments
I'm excited to see this issue as I integrated streamz and networkx in my trading bot, it works very well. |
@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! |
We have a networkx graph model of the forex exchanges, each node has a Streaming dataframe that sinks market data to the next node in the calculation. So they end up becoming one graph with the Steamz df becoming an attribute on the forex graph, but we conceptually think of them as two different graphs with the Streamz graph having nodes not it the forex graph, like when we take market data from two market and zip it into a Streaming dataframe node. We did not modify the Streamz library though. We did subclass DiGraph so I can agree on that point. Networkx also made it easier to visualize the data streams we send to the browser, we traverse the graph to find the nodes the user wants to visualize. Not sure if that helps. |
@opensourcechris Would you be able to put some of that code up? I'm particularly interested to see the subclass of DiGraph (since I was working on that too) and the browser driven visualization. |
Probably I could share some obfuscated snippets, let me check with my leadership. |
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:
graph3 = nx.compose(graph2, graph1)
. Graph3 has nodes from both graphs allowing the graphs themselves to be built modularly.UC2:
[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:add_node
which now needs to take in a node class, args and kwargs and a nameadd_edge
which now need to take in eitheradd_edge_from
so compose works properly.Most of the overrides either need to init new nodes or provide connections between nodes.
The text was updated successfully, but these errors were encountered: