From d451b660ec1ebe50ef00317f22f5f80c01b14a0f Mon Sep 17 00:00:00 2001 From: Alexander Barth Date: Mon, 20 Nov 2023 09:28:01 +0100 Subject: [PATCH] make getindex(ds::Dataset, key) more specific for upcoming CommonDataModel 0.3 --- Project.toml | 2 +- src/dataset.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 7b0d7fd..0d1351b 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "GRIBDatasets" uuid = "82be9cdb-ee19-4151-bdb3-b400788d9abc" authors = ["tcarion and contributors"] -version = "0.3.0" +version = "0.3.1" [deps] CommonDataModel = "1fbeeb36-5f17-413c-809b-666fb144f157" diff --git a/src/dataset.jl b/src/dataset.jl index 1b6c71c..431db8a 100644 --- a/src/dataset.jl +++ b/src/dataset.jl @@ -24,7 +24,7 @@ GRIBDataset(filepath::AbstractString; filter_by_values = Dict()) = GRIBDataset(F Base.keys(ds::Dataset) = getvars(ds) Base.haskey(ds::Dataset, key) = key in keys(ds) -Base.getindex(ds::Dataset, key) = cfvariable(ds, string(key)) +Base.getindex(ds::Dataset, key::Union{Symbol,AbstractString}) = cfvariable(ds, string(key)) getlayersid(ds::GRIBDataset) = ds.index["paramId"] getlayersname(ds::GRIBDataset) = string.(ds.index["cfVarName"])