JuliaArrays / JuliaArrays/OffsetArrays.jl
Missing `diff` for OffsetVector
Open
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 212
- Forks
- 45
- PR merge metrics
- No merged PRs in 30d
Description
I noted Base.diff does not work for OffsetArrays. MWE
julia> x = OffsetVector([0, 1, 2, 3], 0:3)
julia> diff(x)
ERROR: ArgumentError: offset axes unsupported
Stacktrace:
[1] #diff#395(::Int64, ::Function, ::OffsetArray{Int64,1,Array{Int64,1}}) at ./multidimensional.jl:741
[2] #diff at ./none:0 [inlined]
[3] diff(::OffsetArray{Int64,1,Array{Int64,1}}) at ./multidimensional.jl:708
[4] top-level scope at none:0
It would be nice to have this.
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 OffsetVector and Base.diff MWE from the issue, then inspect the OffsetArrays handling around the multidimensional.jl stack-trace location. Determine the expected diff result for offset axes and verify that the operation no longer raises the offset-axis error.
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