Comments (9)
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.
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.
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.
Great find @Islast (and our fellow
from scona.
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.
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.
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.
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.
Travis builds are now passing as of pull request #49
from scona.
Related Issues (20)
- Add padding to the colorbar at the bottom HOT 3
- calculate_nodal_measures doesn't work on graph bundles HOT 1
- Pad random graphs with 0s so they are in the right order HOT 4
- Set seed for Erdos Renyi graph in plot degree distribution HOT 4
- Include small world in plot_network_measures HOT 3
- Which version of nilearn do we need? HOT 1
- Cut covars columns from residuals matrix HOT 1
- feature request: tell brainbundle the total number of brains you want
- Catch error if name of graph doesn't exist in brain bundle for plot_rich_club HOT 4
- Adjust legend of plot_rich_club HOT 3
- small_world calculations HOT 1
- Nodal measures for plotting with nilearn HOT 5
- Plots of brains in plotting anatomical network HOT 2
- View Connectome with nilearn HOT 5
- Error with nilearn.plot_connectome HOT 1
- Test for visualisations HOT 1
- Removing old viz modules
- View_corr_mat() - make new || leave old HOT 5
- Make new get_anatomical_layouts() function HOT 1
- Two similar tutorials HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scona.