SciML / SciML/ComponentArrays.jl

labels and valkeys does not work on Axis

Open
#89 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
375
Forks
42
Avg merge
7h 25m
Merged PRs (30d)
17

Description

I'm not sure if there is anything preventing this, but it would sometimes be convenient to be able to ask about the labels in an axis, similar to how it can be done for a ComponentArray.

julia> uax
Axis(u1 = 1, u2 = 2)

julia> labels(uax)
""

julia> valkeys(uax)
ERROR: MethodError: no method matching valkeys(::Axis{(u1 = 1, u2 = 2)})
Closest candidates are:
  valkeys(::ComponentVector{T, A, Axes} where {T, A, Axes}) at /home/fredrikb/.julia/packages/ComponentArrays/Xo6aP/src/componentarray.jl:313
Stacktrace:
 [1] top-level scope
   @ REPL[27]:1

If I try to indx into an Axis with integers, I get something, but I can't judge if it makes sense or not.

julia> uax[1]
ComponentIndex(1, NullAxis())

julia> uax[2]
ComponentIndex(2, NullAxis())

julia> uax[1:2]
ComponentIndex(1:2, FlatAxis())

I'm trying to implement indexing with symbols (https://github.com/jonniedie/ComponentArrays.jl/issues/88) and this issue came up.

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

Reproduce the Axis, labels, valkeys, and integer-indexing examples from the issue, then compare them with ComponentArray behavior in componentarray.jl around line 313. Review the related symbol-indexing issue #88 and establish the expected Axis behavior before adding tests that demonstrate the completed interface.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 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.