Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
fgrunewald committed Oct 2, 2024
1 parent 620f538 commit 45f649e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cgsmiles/graph_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def sort_nodes_by_attr(graph, sort_attr="fragid"):
nx.Graph
graph with nodes sorted in correct order
"""
fragids = nx.get_node_attributes(graph, "fragid")
fragids = nx.get_node_attributes(graph, sort_attr)
sorted_ids = sorted(fragids.items(), key=lambda item: (item[1], item[0]))
mapping = {old[0]: new for new, old in enumerate(sorted_ids)}
new_graph = nx.relabel_nodes(graph, mapping, copy=True)
Expand Down

0 comments on commit 45f649e

Please sign in to comment.