Open mtfishman opened 4 months ago
I would expect union
to perform a union
on the edge_data
for edges in both g1
and g2
. A more appropriate name for this function may be merge
, which would also reveal that argument order matters (which I found counterintuitive for union
mathematically speaking, but is also relevant for Base.union
).
I could see an argument for giving it a different name (I think the closest function in modern Julia would be mergewith
). The reason for calling it union
is that it is a union of the underlying graphs. Then you can control how the data is merged with extra keyword arguments: https://github.com/mtfishman/DataGraphs.jl/blob/v0.1.12/src/abstractdatagraph.jl#L192-L204
Basically, the current definition follows more closely to the definition of a graph union as a union of the vertices and edges: https://en.wikipedia.org/wiki/Graph_operations#Binary_operations.
The precedence of data overwriting in
union
ofDataGraph
s is inconsistent withunion
for other types:compared to: