d7b2db3c5262c82c44958afc2500efe0838f0884,osmnx/utils_graph.py,,_update_edge_keys,#Any#,536

Before Change


    // for each unique different street, iterate its key + 1 so it"s unique
    for u, v, k in set(different_streets):
        // filter out key if it appears in data dict as we"ll pass it explicitly
        attributes = {k: v for k, v in G[u][v][k].items() if k != "key"}
        G.add_edge(u, v, key=k + 1, **attributes)
        G.remove_edge(u, v, key=k)

After Change


    utils.log(f"Found {len(set_different_streets)} different streets")
    for u, v, k in set(different_streets):
        new_key = max(list(G[u][v]) + list(G[v][u])) + 1
        G.add_edge(u, v, key=new_key, **G.get_edge_data(u, v, k))
        G.remove_edge(u, v, key=k)

    return G
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: gboeing/osmnx
Commit Name: d7b2db3c5262c82c44958afc2500efe0838f0884
Time: 2020-12-02
Author: boeing@usc.edu
File Name: osmnx/utils_graph.py
Class Name:
Method Name: _update_edge_keys


Project Name: gboeing/osmnx
Commit Name: 984b805d094c3abcf44df1f135fec36d912261f7
Time: 2017-08-22
Author: gboeing@berkeley.edu
File Name: osmnx/plot.py
Class Name:
Method Name: plot_graph_route


Project Name: gboeing/osmnx
Commit Name: b2be440a78c9da841c3f1bdfa34e5dc0dc1e669c
Time: 2020-11-19
Author: boeing@usc.edu
File Name: osmnx/utils_graph.py
Class Name:
Method Name: _update_edge_keys


Project Name: gboeing/osmnx
Commit Name: 21b84ebed97330c3f9214d5817476ed7fe7c03d6
Time: 2017-08-22
Author: gboeing@berkeley.edu
File Name: osmnx/utils.py
Class Name:
Method Name: get_route_edge_attributes