f1bf374b72cfe3575f9ca48290641b9fb8c7758d,osmnx/utils_graph.py,,graph_from_gdfs,#Any#Any#Any#,105

Before Change



    // add edges and their attributes to graph, but filter out null attribute
    // values so that edges only get attributes with non-null values
    for u, v, k, edge_vals in zip(gdf_edges["u"], gdf_edges["v"], gdf_edges["key"], attr_values):
        edge_attrs = zip(attr_names, edge_vals)
        data = {name: val for name, val in edge_attrs if isinstance(val, list) or pd.notnull(val)}
        G.add_edge(u, v, key=k, **data)

After Change



    // add edges and their attributes to graph, but filter out null attribute
    // values so that edges only get attributes with non-null values
    attr_names = gdf_edges.columns.to_list()
    for (u, v, k), attr_vals in zip(gdf_edges.index, gdf_edges.values):
        data_all = zip(attr_names, attr_vals)
        data = {name: val for name, val in data_all if isinstance(val, list) or pd.notnull(val)}
        G.add_edge(u, v, key=k, **data)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 2

Instances


Project Name: gboeing/osmnx
Commit Name: f1bf374b72cfe3575f9ca48290641b9fb8c7758d
Time: 2020-11-18
Author: boeing@usc.edu
File Name: osmnx/utils_graph.py
Class Name:
Method Name: graph_from_gdfs


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


Project Name: polyaxon/polyaxon
Commit Name: e4d9e457522eef615a9442dcc0c7fe4c685e24df
Time: 2017-09-28
Author: mouradmourafiq@gmail.com
File Name: polyaxon_schemas/polyaxonfile/parser.py
Class Name: Parser
Method Name: _parse_graph