-
Notifications
You must be signed in to change notification settings - Fork 56
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
Networkx deprecations #525
Comments
Thanks for the report. Though we don't use |
AttributeError Traceback (most recent call last) File ~/miniforge3/envs/processor/lib/python3.12/site-packages/momepy/utils.py:438, in nx_to_gdf(net, points, lines, spatial_weights, nodeID) File ~/miniforge3/envs/processor/lib/python3.12/site-packages/momepy/utils.py:319, in _primal_to_gdf(net, points, lines, spatial_weights, node_id) AttributeError: module 'networkx' has no attribute 'to_scipy_sparse_matrix' |
It is truncated. Can you open the full version in VS Code and copy that please? Also, this shows a different error than reported above? |
I think that the issue comes from the outdated |
Closing due to missing info. Can reopen if it pops up again in relevant versions. |
Describe the problem
AttributeError: module 'networkx' has no attribute 'connected_component_subgraphs' occurs when networkx is used because the function is depreciated in networkx 2.3
https://stackoverflow.com/questions/61154740/attributeerror-module-networkx-has-no-attribute-connected-component-subgraph
Steps to reproduce
Momepy implementation
degree = dict(nx.degree(primal))
nx.set_node_attributes(primal, degree, 'degree')
graph = momepy.node_degree(primal, name='degree')
nodes, edges, sw = momepy.nx_to_gdf(graph, points=True, lines=True,
spatial_weights=True)
f, ax = plt.subplots(figsize=(10, 10))
nodes.plot(ax=ax, column='degree', cmap='tab20b', markersize=(nodes['degree'] * 100), zorder=2)
edges.plot(ax=ax, color='lightgrey', zorder=1)
ax.set_axis_off()
plt.show()
Versions of your packages
Your operating system
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: