JuliaArrays / JuliaArrays/StaticArrays.jl

Indexing SArray with SArray of CartesianIndex creates an MArray

Open
#635 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

arrays bug
Dominant language
Julia
Stars
844
Forks
159
Avg merge
3d 21h
Merged PRs (30d)
3

Description

For example (on StaticArrays v0.11)

julia> b = SVector(1);

julia> b[SVector(1)]
1-element SArray{Tuple{1},Int64,1,1}:
 1

julia> b[SVector(CartesianIndex(1))]
1-element MArray{Tuple{1},Int64,1,1}:
 1

Shouldn't this be an SArray?

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

Reproduce the two indexing examples from the issue on StaticArrays v0.11, then inspect the indexing methods responsible for SVector inputs containing CartesianIndex values. Done means indexing an SArray with an SArray of CartesianIndex returns an SArray rather than an MArray, while preserving the shown values.

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
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.