b013b12999b16e11a5b965ae3ac0c9301c6888fa,osmnx/distance.py,,add_edge_lengths,#Any#Any#,105

Before Change


        raise KeyError("some edges missing nodes, possibly due to input data clipping issue")

    // 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"])
    dists = dists.fillna(value=0).round(precision)
    nx.set_edge_attributes(G, name="length", values=dists)

After Change



    // calculate great circle distances, fill nulls with zeros, then round
    dists = great_circle_vec(coords[:, 0], coords[:, 1], coords[:, 2], coords[:, 3])
    dists[np.isnan(dists)] = 0
    values = zip(uvk, dists.round(precision))
    nx.set_edge_attributes(G, values=dict(values), name="length")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: gboeing/osmnx
Commit Name: b013b12999b16e11a5b965ae3ac0c9301c6888fa
Time: 2021-04-05
Author: boeing@usc.edu
File Name: osmnx/distance.py
Class Name:
Method Name: add_edge_lengths


Project Name: interactiveaudiolab/nussl
Commit Name: 657f91e2b73f8e0a0661784a93310ae8704fe2ec
Time: 2017-01-16
Author: eth@nmanilow.com
File Name: nussl/repet.py
Class Name: Repet
Method Name: _compute_repeating_mask


Project Name: gboeing/osmnx
Commit Name: c178e788a3e34a74a3facff5848baa374f4506fa
Time: 2021-03-13
Author: boeing@usc.edu
File Name: osmnx/stats.py
Class Name:
Method Name: circuity_avg