JuliaArrays / JuliaArrays/AxisArrays.jl

Feature Request: Rational index should be interpreted categorically

Open
#181 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Example:

julia> x = AxisArray(rand(3), foo=[1//2, 1//3, 1//4])
julia> x[foo=atvalue(1//2)]
ERROR: BoundsError: attempt to access 3-element Array{Rational{Int64},1} at index [TolValue(1//2, tol=0//1)]

Seems to me that this should work the same way it does for symbols.

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 Julia example with an AxisArray whose foo axis contains rational values, then inspect the existing categorical indexing path used for symbols and the handling of atvalue. Done means x[foo=atvalue(1//2)] selects the matching element rather than raising a BoundsError, with coverage for rational axis values.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.