ITensor / ITensor/DataGraphs.jl

Fix `union` precedence

Open
#22 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
13
Forks
4
Avg merge
5d 13h
Merged PRs (30d)
2

Description

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 => 2 │ 2

compared to:

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the two union examples in the issue and locate the DataGraph union entry point. Compare its overwrite behavior with Julia's union example; done means the DataGraph result follows the same precedence as union for other types, with the behavior covered by a regression check.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.