JuliaGaussianProcesses / JuliaGaussianProcesses/KernelFunctions.jl

getindex with ColVecs

Open
#417 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
275
Forks
41
PR merge metrics
No merged PRs in 30d

Description

We currently return a view to the underlying data when getindex is called on a ColVecs. See https://github.com/JuliaGaussianProcesses/KernelFunctions.jl/blob/2d172125e72ca932133266c3b23d0865bec539df/src/utils.jl#L76

@theogf was the last person to touch this bit of code, but I'm not sure who wrote it initially (I don't think it was me). Perhaps @devmotion ?

My concern is that if you do getindex, rather thanview, my intuition is that I wouldn't get a view of the underlying data back, but a copy in a new location in memory. Any thoughts on whether my intuition is off, or should we change this?

Contributor guide

Open the contributing guide

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 at src/utils.jl around the linked getindex implementation and review how ColVecs indexing is intended to behave in Julia. Resolve whether getindex should return a copy or a view, then ensure the documented behavior and implementation agree.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.