SciML / SciML/ComponentArrays.jl
labels and valkeys does not work on Axis
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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