Closed basselhak closed 6 years ago
Hi @basselhak, thanks for reporting the bug. Yes, this is a bug related to the new internals of networkx; I’m surprised myself that my automated tests didn't catch this.
The fix should be a simple one, so give me an evening to fix this and I’ll get it up on PyPI and conda forge.
Alternatively, if it’s something you’re comfortable handling, and would love to do an open source contribution (I’d love to see ore open source contributors too!), the only changes that are needed are with respect to graph nodes and edges, by casting them as lists. Happy to chat through here (after I finish my lunch).
@basselhak Please try the latest commit 969f464. On my own machine tests pass, but I'd like to get extra confirmation too. If it works on your system too, I'll check the CIs and then make a release.
Hi Eric, Just checked it here and all good now. Thanks for the quick fix! I'd love to contribute in the future, but I'm still fairly new to Python (came across this package on your DataCamp course, which is really great). So give me a while to get up to speed. Happy to share the Jupyter Notebook I'm working on in case you're interested in seeing nxviz applied to network analysis in political science. Best, Jacob
Thanks for helping with the test, Jacob! Even this little bug report is useful. I will be sure to record it in the changelog (which I should start building too). Thanks for taking the DC course too, I'm sure @hugobowne and @yashasroy will be thrilled to hear about this too! :smile:
By the way, I would definitely love to see the Jupyter notebook that you're creating! If you'd like it, I'd love to tweet it around, or even link to it as a contributed example to nxviz.
For some reason my account has just been flagged by Github. No idea why. I just sent in a support request. There's a nxviz tree available on my braindrain repository where the notebook is stored: https://github.com/basselhak/braindrain/tree/nxviz
Not sure if you can see it as long as I'm flagged. You are of course more than welcome to tweet it, but it's still a work-in-progress, and actually, there are a few more things I can't get working through nxviz.
nxviz gives me a KeyError when attempting to set node orders and colors according to some of my node attributes. It works for the bipartite and centrality measures, but not for other attributes I've stored (like 'ORGANIZATION' or 'COUNTRY'), although I've confirmed that all these attributes are stored in the same way. Any idea what's causing this? Not sure if it warrants reporting another issue.
nxviz gives me a KeyError when attempting to set node orders and colors according to some of my node attributes. It works for the bipartite and centrality measures, but not for other attributes I've stored (like 'ORGANIZATION' or 'COUNTRY'), although I've confirmed that all these attributes are stored in the same way. Any idea what's causing this? Not sure if it warrants reporting another issue.
Yeah, talk about this one on a separate issue. It'll help with "grouping"/"tagging" the issues down the road. Feel free to go ahead on that. As for the KeyError, my first hunch is that it's related to number of countries exceeding the number of available colours in the colour mapping. Anyways, let's bring this to a new thread.
For some reason my account has just been flagged by Github. No idea why. I just sent in a support request. There's a nxviz tree available on my braindrain repository where the notebook is stored: https://github.com/basselhak/braindrain/tree/nxviz
Not sure if you can see it as long as I'm flagged. You are of course more than welcome to tweet it, but it's still a work-in-progress, and actually, there are a few more things I can't get working through nxviz.
I can see the notebook, and yes, it's shaping up to be very nice! I'll respect your timeline, and when you feel it's ready for prime time, I'd love to be able to link it as an example of how to use the nxviz API!
Closing this discussion as it looks like it's concluded. @basselhak feel free to reopen if you think otherwise.
Hi @ericmjl ,
Here's the latest version of the network analysis: https://nbviewer.jupyter.org/github/basselhak/braindrain/blob/organizations/brain_drain_politics_organizations.ipynb
I only do a quick visualization with nxviz before moving on to doing the rest in matplotlib, because I need labels for now. Once we get labels working, I think I could update the notebook to do a more extended visualization in nxviz and then you could tweet that as an example of how to use your package, if you like.
If you have any comments or suggestions on the code as it stands now, using matplotlib, feel free to let me know. And thanks for being responsive on the nxviz issues. I really like the package and hope to see it expanded in the future.
Best, Jacob
please the same error is occured ,after running the following code segments in network graph analysis:full package is on github import DBCP as dp import Evaluation as eva
graph_name = 'Biznet.graphml' ctl_list dp.Find_Controller_Placement(graph_name,avg_weight=1.0,max_weight=1.0,inter_weight=1.0)
avgL = eva.Avg_latency_of_end_to_end(graph_name,ctl_list) print ('the average latency of end-to-end communications is',avgL)
Description
When attempting to make any CircosPlot from a NetworkX 2.0 Graph object, I get the following error: "AttributeError: 'NodeView' object has no attribute 'index'". Does this have something to do with NetworkX 2.0 compatibility? I've updated nxviz to the latest github version which lists NetworkX 2.0 in the requirements, so I'm confused as to what's causing this.
What I Did
Here's an example with a random graph.