Closed itsmi closed 5 years ago
Seems like it's still present up till 2.3, and removed in 2.4.
Deprecation notice says this is the replacement:
G.subgraph(c) for c in connected_components(G)
Until this is fixed, just stick to networkx 2.3 or earlier.
Found a solution which works:
> def connected_component_subgraphs(G):
for c in nx.connected_components(G):
yield G.subgraph(c)
This has already been fixed in the master branch.
This is also an issue in mordred
for some reason. Any ideas?
module 'networkx' has no attribute 'biconnected_component_subgraphs' (SpAbs_Dt/SpAbs/mordred._matrix_attributes.Eigen(mordred.DetourMatrix.DetourMatrixCache())/mordred.DetourMatrix.DetourMatrixCache())
This is also an issue in
mordred
for some reason. Any ideas?module 'networkx' has no attribute 'biconnected_component_subgraphs' (SpAbs_Dt/SpAbs/mordred._matrix_attributes.Eigen(mordred.DetourMatrix.DetourMatrixCache())/mordred.DetourMatrix.DetourMatrixCache())
It seems that they are working on that, https://github.com/mordred-descriptor/mordred/issues/84. So you can just basically stick to networkx with version 2.3 in your virtual environment,
pip install --force-reinstall networkx==2.3
This will fix your problem of using mordred
.
Found a solution which works:
> def connected_component_subgraphs(G): for c in nx.connected_components(G): yield G.subgraph(c)
Thank you it works
def connected_component_subgraphs(G): for c in nx.connected_components(G): yield G.subgraph(c)
This did not work for me; I get the same error as before. Am I supposed to just run it in the Python console first?
Ok even more mind boggling, after shaving the yak for a while here trying to get this to work is that I found that the only networkx on the system is this one:
networkx-1.7-py2.7.egg
This is surely version 1.7 which is < 2.4 and thus should not be a problem, right? I'm about to figure out how to tear the egg apart, manually editing the file as needed, and reassemble it. This is ridiculous.
chineste-postman still uses the 'connected_component_subgraphs' feature of 'networkx', which has been deprecated in networkx version 2.1.
The resulting error message is: AttributeError: module 'networkx' has no attribute 'connected_component_subgraphs'
Is there any fix to this issue? Thanks!