Skip to content

Commit

Permalink
keys and getindex for variables more specific
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander-Barth committed Nov 14, 2023
1 parent 330611d commit 9b85239
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cfvariable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -467,13 +467,13 @@ function _isrelated(v1::AbstractVariable,v2::AbstractVariable)
dimnames(v1) dimnames(v2)
end

function Base.keys(v::AbstractVariable)
function Base.keys(v::AbstractNCVariable)
ds = dataset(v)
return [varname for (varname,ncvar) in ds if _isrelated(ncvar,v)]
end


function Base.getindex(v::AbstractVariable,name::SymbolOrString)
function Base.getindex(v::AbstractNCVariable,name::SymbolOrString)
ds = dataset(v)
ncvar = ds[name]
if _isrelated(ncvar,v)
Expand Down

0 comments on commit 9b85239

Please sign in to comment.