Code Monkey home page Code Monkey logo

Comments (9)

Islast avatar Islast commented on August 22, 2024 3

This appears to be a networkx 1 to 2 migration issue. The migration guide seems to recommend using dict(G.degree()) to get the degrees as a dictionary. This should be backwards compatible with networkx 1

from scona.

schae234 avatar schae234 commented on August 22, 2024 1

Do you want to require networkx version 1.9 to fix the Travis tests first? Or are you planning on migrating to version 2.0 to fix things?

from scona.

Islast avatar Islast commented on August 22, 2024

There were a few people at Mozfest who had the AttributeError: 'DegreeView' object has no attribute 'values' error that interrupts builds of python 3.3 and later. I'm using 3.6 but I don't get it.
Verbatim the error is:

Traceback (most recent call last):
  File "/home/travis/build/WhitakerLab/BrainNetworksInPython/tests/regression_tests.py", line 17, in setUpClass
    write_fixtures('/tmp')
  File "/home/travis/build/WhitakerLab/BrainNetworksInPython/tests/write_fixtures.py", line 80, in write_fixtures
    recreate_network_analysis_fixture(folder, corrmat_path)
  File "/home/travis/build/WhitakerLab/BrainNetworksInPython/tests/write_fixtures.py", line 49, in recreate_network_analysis_fixture
    names_308_style=True)
  File "/home/travis/build/WhitakerLab/BrainNetworksInPython/wrappers/network_analysis_from_corrmat.py", line 229, in network_analysis_from_corrmat
    names_308_style=names_308_style)
  File "/home/travis/build/WhitakerLab/BrainNetworksInPython/scripts/make_graphs.py", line 383, in calculate_nodal_measures
    deg = G.degree().values()
AttributeError: 'DegreeView' object has no attribute 'values'

At this point in the code, G.degree() should be a dict object. G.degree is a DegreeView object.

from scona.

KirstieJane avatar KirstieJane commented on August 22, 2024

Great find @Islast (and our fellow 🐛 finders at MozFest!)

from scona.

Islast avatar Islast commented on August 22, 2024

Good question @schae234 ! I think we will definitely want to migrate to networkx version 2.0 sometime. But for now I we should probably change Travis to use version 1.9. If our Travis builds pass after that we can close this issue and create a new "networkx verison 2.0 compatability issue"

from scona.

schae234 avatar schae234 commented on August 22, 2024

Hi @Islast , that sounds like a good plan! I have a fork thats passing with python version 3.6, but the regression tests fail for other versions of python. I'm still looking into it! 👍

Do you know if there is a way to get the tests to be more verbose? I'm not familiar with the unittest package

from scona.

Islast avatar Islast commented on August 22, 2024

Great job @schae23 ! I believe you use a -v to get "verbose" detail, as in:

 python3 -m unittest discover -v -p '*_tests.py

in the .travis.yml

from scona.

Islast avatar Islast commented on August 22, 2024

Some thoughts about why the non-3.6 tests might be failing.

  • The regression tests compare to files that were generated (using a fixed random seed) in python 3.6
  • I notice that the corrmat tests don't fail - this is the only file that is created without using networkx
  • The global and rich club measures both use the random seed, and these tests both fail, but the local measures do not use the random seed and they fail too

@schae234 if you feel like keeping going on this please do! If not, the work you've already done is extremely helpful 🌺
Feel free to PR whenever

from scona.

Islast avatar Islast commented on August 22, 2024

Travis builds are now passing as of pull request #49

from scona.

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.