JuliaCollections / JuliaCollections/DataStructures.jl
`setdiff(::Accumulator, xs)` is incorrect for xs not being an accumulator
Open
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 745
- Forks
- 261
- PR merge metrics
- No merged PRs in 30d
Description
Consider:
julia> x = [1, 2, 2, 3, 3, 3];
# Correct answer:
julia> setdiff(counter(x), counter(unique(x)))
Accumulator{Int64,Int64} with 2 entries:
2 => 1
3 => 2
# Incorrect behavour
julia> setdiff(counter(x), unique(x))
3-element Array{Pair{Int64,Int64},1}:
2 => 2
3 => 3
1 => 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Julia examples in the issue and then inspect the setdiff methods involving Accumulator, counter, and unique. Done means setdiff(counter(x), unique(x)) returns the expected Accumulator result with the correct counts for 2 and 3.
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
- 38/100