mcabbott / mcabbott/AxisKeys.jl

`ProjectTo` is too permissive?

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

Nobody has claimed this yet.

Dominant language
Julia
Stars
154
Forks
31
PR merge metrics
No merged PRs in 30d

Description

Maybe this should be an error?

julia> using AxisKeys

julia> ka = wrapdims(rand(3, 2), obs=1:3, point=["a", "b"]);

julia> kb = wrapdims(rand(3, 2), obs=1:3, point=["c", "d"]);

julia> ProjectTo(ka)(kb)
2-dimensional KeyedArray(NamedDimsArray(...)) with keys:
↓   obs ∈ 3-element UnitRange{Int64}
→   point ∈ 2-element Vector{String}
And data, 3×2 Matrix{Float64}:
      ("a")      ("b")
 (1)   0.928905   0.705413
 (2)   0.493408   0.997449
 (3)   0.877819   0.816695

We probably want to think about similar things as in https://github.com/invenia/NamedDims.jl/pull/201#issuecomment-1201180921

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 shown ProjectTo(ka)(kb) example and read the ProjectTo entry point. Review the referenced NamedDims.jl discussion to determine when mismatched keys should raise an error, then define the intended behavior and add coverage for the agreed cases.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.