JuliaData / JuliaData/SplitApplyCombine.jl
Returned Dictionaries.Dictonary type does not adhere to Julia Dict interface
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 154
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Description
I was expecting to be able to iterate through these grouped dictionaries, but I'm noticing they do not seem to follow the AbstractDict interface. Is this an intentional design decision? If so, is there a benefit to this counterintuitive behavior?
julia> group(iseven, 1:5)
2-element Dictionaries.Dictionary{Bool, Vector{Int64}}
false │ [1, 3, 5]
true │ [2, 4]
julia> Dict(false => [1, 3, 5], true => [2, 4])
Dict{Bool, Vector{Int64}} with 2 entries:
0 => [1, 3, 5]
1 => [2, 4]
julia> collect(group(iseven, 1:5))
2-element Vector{Vector{Int64}}:
[1, 3, 5]
[2, 4]
julia> collect(Dict(false => [1, 3, 5], true => [2, 4]))
2-element Vector{Pair{Bool, Vector{Int64}}}:
0 => [1, 3, 5]
1 => [2, 4]
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 grouped-dictionary iteration examples in Julia and compare them with the AbstractDict and Dict interfaces. Determine the intended iteration behavior and document a concrete acceptance criterion before identifying the relevant implementation and tests; done means the behavior is agreed and covered by regression tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100