Outside of dhlab.legacy, networkx is currently used only for the purpose of converting an nx-compatible "edge list" to an nx graph object, immediately before returning it to the user:
|
G = nx.Graph() |
|
G.add_weighted_edges_from(edges) |
|
return G |
|
G.add_weighted_edges_from(edgelist) |
|
|
|
return G |
As the library stands right now, there is no particular need for it to be reworked. However, if the legacy part of the library will end up getting deprecated or lazily imported, then these two pieces of code will be the only remaining nx dependencies.
If dhlab.legacy does get removed, I suggest we instead just return the computed edge lists, and let the user do the G.add_weighted_edges_from(edges) step themselves, if desired.
Outside of
dhlab.legacy, networkx is currently used only for the purpose of converting an nx-compatible "edge list" to an nx graph object, immediately before returning it to the user:DHLAB/dhlab/text/nb_search_text.py
Lines 54 to 56 in 1c14cf9
DHLAB/dhlab/api/nb_ngram_api.py
Lines 67 to 69 in 1c14cf9
As the library stands right now, there is no particular need for it to be reworked. However, if the
legacypart of the library will end up getting deprecated or lazily imported, then these two pieces of code will be the only remaining nx dependencies.If
dhlab.legacydoes get removed, I suggest we instead just return the computed edge lists, and let the user do theG.add_weighted_edges_from(edges)step themselves, if desired.