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

Before Change


    try:
        coords = (
            (u, v, k, G.nodes[u]["y"], G.nodes[u]["x"], G.nodes[v]["y"], G.nodes[v]["x"])
            for u, v, k in G.edges
        )
    except KeyError:  // pragma: no cover
        raise KeyError("some edges missing nodes, possibly due to input data clipping issue")

After Change


    // extract edge IDs and corresponding coordinates from their nodes
    uvk = tuple(G.edges)
    x = G.nodes(data="x")
    y = G.nodes(data="y")
    try:
        coords = np.array([(y[u], x[u], y[v], x[v]) for u, v, k in uvk])
    except KeyError:  // pragma: no cover
        raise KeyError("some edges missing nodes, possibly due to input data clipping issue")

    // 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: 6

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: vatlab/SoS
Commit Name: c8788d2eedcdb2671289d7d47a41b8fdcb0294f1
Time: 2017-09-11
Author: ben.bog@gmail.com
File Name: src/sos/sos_executor.py
Class Name: Base_Executor
Method Name: resolve_dangling_targets


Project Name: gboeing/osmnx
Commit Name: 3208fe37c6787ef0cd3f2f973a02ad63995042fa
Time: 2021-03-26
Author: boeing@usc.edu
File Name: osmnx/bearing.py
Class Name:
Method Name: add_edge_bearings