Code Monkey home page Code Monkey logo

Comments (8)

bradleysawler avatar bradleysawler commented on July 30, 2024 20

Found a solution which works:

> def connected_component_subgraphs(G):
    for c in nx.connected_components(G):
        yield G.subgraph(c)

from chinese-postman.

rkistner avatar rkistner commented on July 30, 2024 10

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.

from chinese-postman.

rkistner avatar rkistner commented on July 30, 2024

This has already been fixed in the master branch.

from chinese-postman.

ademidun avatar ademidun commented on July 30, 2024

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())

from chinese-postman.

FanwangM avatar FanwangM commented on July 30, 2024

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, mordred-descriptor/mordred#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.

from chinese-postman.

adityasbg avatar adityasbg commented on July 30, 2024

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

from chinese-postman.

michael-ts avatar michael-ts commented on July 30, 2024

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?

from chinese-postman.

michael-ts avatar michael-ts commented on July 30, 2024

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.

from chinese-postman.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.