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)

    utils.log("Added edge lengths to graph")

After Change


        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: catalyst-cooperative/pudl
Commit Name: 5aaa63d7ecf85d341fec9b758d17f2bf4cde6042
Time: 2020-03-11
Author: zane.selvans@catalyst.coop
File Name: src/pudl/transform/ferc1.py
Class Name: FERCPlantClassifier
Method Name: predict


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