Git Product home page Git Product logo

Comments (3)

aestrivex avatar aestrivex commented on July 22, 2024

No, I don't think so.

With reference to the one unit test of test_link_communities, the test case is as follows:

def test_link_communities():
    x = load_sample(thres=0.4)
    seed = 949389104
    M = bct.link_communities(x)
    assert np.max(M) == 1

This four line test case takes over an hour to run.

The reason is, the algorithm is simply very slow. I didn't write the algorithm, the people who designed it wrote it to be very slow. The python implementation is even slower. I haven't explored why the python implementation is very slow, but even the matlab implementation would take more than ten minutes to run I suspect.

I don't know how to fix it. At some point I may return to this function to try to see if I can optimize the algorithm to at least achieve closer to the matlab performance, but that would take a lot of effort and I don't have time to do that right now.

I would actually favor commenting out the unit test for now if it is a serious problem that the test runs too long, because I think link_communities takes too long to run for anyone to want to use it anyway when they could get mostly acceptable performance from functions like modularity_und.

from bctpy.

clbarnes avatar clbarnes commented on July 22, 2024

Agreed on that, I'd be happy to disable the test and maybe stick a warnings.warn("Don't use this algorithm") in the method itself. I was more wondering if the sample data could be simplified so that the algorithm was doing the bare minimum to prove function, but glancing at the algorithm I guess it needs quite a complex data set to return much at all.

from bctpy.

clbarnes avatar clbarnes commented on July 22, 2024

Just going through the tests at the moment so I'll note down the ones which might be problematic:

nbs_tests.py: quite slow
modularity_derived_metrics_test.py: some runtime warnings

from bctpy.

Related Issues (20)

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.