Skip to content

Inconsistent AxisVector indexing #2348

@imreddyTeja

Description

@imreddyTeja

Indexing a 1d axis vector behaves differently than indexing a 2d axis vector:

julia> v1 = ClimaCore.Geometry.Covariant1Vector(1.0)
1-element ClimaCore.Geometry.Covariant1Vector{Float64} with indices ClimaCore.Geometry.CovariantAxis{(1,)}():
 1.0

julia> v2 = ClimaCore.Geometry.Covariant12Vector(1.0, 2.0)
2-element ClimaCore.Geometry.Covariant12Vector{Float64} with indices ClimaCore.Geometry.CovariantAxis{(1, 2)}():
 1.0
 2.0

julia> v2.u
u₁
u₂
u₃
julia> v2.u₃
0.0

julia> v1.u₃
1.0

Ran on ClimaCore v0.14.34

Julia Version 1.10.9
Commit 5595d20a287 (2025-03-10 12:51 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin24.0.0)
  CPU: 8 × Apple M3
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)
Threads: 1 default, 0 interactive, 1 GC (on 4 virtual cores)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions