YAXArrays.jl icon indicating copy to clipboard operation
YAXArrays.jl copied to clipboard

Insensitive to capital letters and dimension names in general

Open dpabon opened this issue 2 years ago • 0 comments

In the following MWE

using YAXArrays
using DimensionalData
using Dates
using Zarr

axlist = (
    Dim{:Ti}(Date("2022-01-01"):Day(1):Date("2022-01-30")),
    Dim{:lon}(range(1, 10, length=10)),
    Dim{:lat}(range(1, 5, length=15)),
    Dim{:Variable}(["var1", "var2"])
    )

data1 = rand(30, 10, 15, 2)
ds1 = YAXArray(axlist, data1)

ds1[Variable = At("var1")]

if you do


ds1[variable = At("var1")]

ds1[var = At("var1")]

ds1[v = At("var1")]

Weirdly, all the previous options return "var1", when the expected behavior is to fail as non "variable", "var", or "v" exist as dimensions. I'm not certain if this is an issue with DimensionalData or YAXArrays.

# Only this one fails
ds1[d = At("var1")]

dpabon avatar Sep 25 '23 17:09 dpabon