Skip to content

Fix union precedence #22

@mtfishman

Description

@mtfishman

The precedence of data overwriting in union of DataGraphs is inconsistent with union for other types:

julia> using DataGraphs

julia> g1 = DataGraph(4);

julia> g2 = DataGraph(4);

julia> g1[1 => 2] = 1;

julia> g2[1 => 2] = 2;

julia> union(g1, g2)
DataGraph{Int64, Any, Any, Graphs.SimpleGraphs.SimpleGraph{Int64}, Graphs.SimpleGraphs.SimpleEdge{Int64}} with 4 vertices:
Base.OneTo(4)

and 0 edge(s):

with vertex data:
0-element Dictionaries.Dictionary{Int64, Any}

and edge data:
1-element Dictionaries.Dictionary{Graphs.SimpleGraphs.SimpleEdge{Int64}, Any}
 Edge 1 => 22

compared to:

julia> union(Any[1], Any[1.0])
1-element Vector{Any}:
 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions