JuliaArrays / JuliaArrays/BlockArrays.jl

Functionality for slicing with unit ranges that preserves block information

Open
#347 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
254
Forks
39
PR merge metrics
No merged PRs in 30d

Description

Indexing with UnitRange does not preserve the blocking of blocked arrays:

julia> using BlockArrays

julia> r = blockedrange([2, 4])
2-blocked 6-element BlockedUnitRange{Int64, Vector{Int64}}:
 1
 2
 ─
 3
 4
 5
 6

julia> r[2:4]
2:4

and:

julia> a = BlockArray(randn(4, 4), [2, 2], [2, 2])
2×2-blocked 4×4 BlockMatrix{Float64}:
 0.372344   -0.735109  │   0.316133  -0.935035
 2.37641     1.30943   │  -0.931113   0.339143
 ──────────────────────┼──────────────────────
 0.422144    0.839572  │  -1.4721    -0.74205 
 0.0436636  -0.722946  │   0.799941  -0.192523

julia> a[2:3, 2:3]
2×2 Matrix{Float64}:
 1.30943   -0.931113
 0.839572  -1.4721

It would be nice to have convenient functionality for indexing with UnitRange that does preserve blocking.

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 UnitRange examples for blockedrange and BlockArray in Julia, then inspect the existing indexing behavior for BlockedUnitRange and BlockArray. Define how sliced ranges and arrays should retain block information; done means both examples return blocked results with appropriate block boundaries.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.