Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nxviz doesn't work with networkx 2.4 due to a regression #585

Open
dridk opened this issue Jan 28, 2020 · 6 comments
Open

nxviz doesn't work with networkx 2.4 due to a regression #585

dridk opened this issue Jan 28, 2020 · 6 comments

Comments

@dridk
Copy link

dridk commented Jan 28, 2020

  • nxviz version: 0.6.1
  • Python version: 3.7.4
  • Operating System: Linux

Description

The following example doesn't work with networkx 2.4 :

from random import choice

import matplotlib.pyplot as plt
import networkx as nx
from nxviz.plots import CircosPlot

G = nx.barbell_graph(m1=10, m2=3)
for n, d in G.nodes(data=True):
    G.nodes[n]["class"] = choice(["a", "b", "c", "d", "e"])
    
c = CircosPlot(
    G,
    node_color="class"
)
c.draw()

It returns the following exception:

AttributeError: 'Graph' object has no attribute 'node'

How to solve

I installed networkx 2.3 and it works. As you can see Graph.node is depreacted :
https://networkx.github.io/documentation/stable/release/release_2.4.html#deprecations

@ericmjl
Copy link
Owner

ericmjl commented Jan 28, 2020

@dridk thanks for raising this. This one sounds like a find-and-replace type of API fix.

If this is urgent, would you be open to putting in a PR? (I'm also looking to expand the project contributors list - and welcome many more contributors to the project.)

If not, I should be able to find a sliver of time this weekend to work on it.

@dridk
Copy link
Author

dridk commented Jan 29, 2020

It seems it's already fixed :
bfb9b10#diff-70d0d6a0b9b0ece30f133240b5f2dcd1L263

But this modification is not avaible in the last conda package and last pypi

@ericmjl
Copy link
Owner

ericmjl commented Jan 29, 2020

hmmm, I might not have cut a release, then. Thanks for the catch and digging in. This one's a patch - the PyPI version will go out within the next 10 minutes, conda-forge might take an hour or so before I see the PR on the conda-forge feedstock.

For now, can you confirm that nxviz on master works with NetworkX 2.4?

@ericmjl
Copy link
Owner

ericmjl commented Jan 29, 2020

FYI, 0.6.2 was just released to PyPI. It's also 6:20 am here, so I'm going to be off this issue tracker while at work.

@dridk
Copy link
Author

dridk commented Jan 29, 2020

I confirm it works on master branch and pass all the test.

@ericmjl
Copy link
Owner

ericmjl commented Jan 29, 2020

Would you be kind enough to try out the latest conda-forge or PyPI release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants