08884e278540cc3b3cbe780f6695bc8cbb4c05b6,osmnx/utils_graph.py,,add_edge_lengths,#Any#Any#,146

Before Change



    // turn the coordinates into a DataFrame indexed by u, v, k
    cols = ["u", "v", "k", "u_y", "u_x", "v_y", "v_x"]
    df = pd.DataFrame(coords, columns=cols).set_index(["u", "v", "k"])

    // calculate great circle distances, fill nulls with zeros, then round
    dists = distance.great_circle_vec(df["u_y"], df["u_x"], df["v_y"], df["v_x"])

After Change


        raise KeyError(f"Edge(s) missing nodes {missing_str} possibly due to clipping issue")

    df_coords = pd.DataFrame(coords, columns=["u", "v", "k", "u_y", "u_x", "v_y", "v_x"])
    df_coords[["u", "v", "k"]] = df_coords[["u", "v", "k"]].astype(np.int64)
    df_coords = df_coords.set_index(["u", "v", "k"])

    // then calculate the great circle distance with the vectorized function
    gc_distances = distance.great_circle_vec(
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


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


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


Project Name: instacart/lore
Commit Name: 644f6485707aaf7d670216f7ea0885b7a0bc8a26
Time: 2017-12-08
Author: montanalow@users.noreply.github.com
File Name: lore/encoders.py
Class Name: Token
Method Name: transform