You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This means that when using versions of networkx greater or equal to 2.4, when running the florentime_families example notebook, the code chunk pasted below results in an error:
for f in G.nodes():
for i, c in enumerate(communities):
if f in c:
G.node[f].update({"community" : str(i),
"centrality" : centralities[f],
"name" : f
})
AttributeError: 'Graph' object has no attribute 'node'
It can be fixed by changing the bit that says G.node[f].update to G.nodes[f].update, though I'm not sure if a bigger change involving refactoring the code a little and using G.set_node_attributes() instead might be a better solution that works on all versions.
If it'd be helpful, I could submit a PR with one of the suggested fixes?
The text was updated successfully, but these errors were encountered:
This issue is fixed in my fork (which was originally made precisely to have a version with fixes from issues and PRs).
The fork has now been detached and released as its own library, altair-nx, because the original has been inactive since 2020 and because the fork diverged from it considerably after a full code-base rework and the implementation of new features (e.g. curved edges, self loops, and much greater customisability).
In networkx >= 2.4, the
Graph.node
function has been deprecated in favour ofGraph.nodes
(see https://networkx.org/documentation/stable/release/release_2.4.html#deprecations).This means that when using versions of networkx greater or equal to 2.4, when running the florentime_families example notebook, the code chunk pasted below results in an error:
AttributeError: 'Graph' object has no attribute 'node'
It can be fixed by changing the bit that says
G.node[f].update
toG.nodes[f].update
, though I'm not sure if a bigger change involving refactoring the code a little and usingG.set_node_attributes()
instead might be a better solution that works on all versions.If it'd be helpful, I could submit a PR with one of the suggested fixes?
The text was updated successfully, but these errors were encountered: