diff --git a/src/types.jl b/src/types.jl index 34b58362..fbb68e1d 100644 --- a/src/types.jl +++ b/src/types.jl @@ -1,4 +1,7 @@ # All types using in `NCDatasets` +# Note in CommonDataModel the special properties `attrib`, `dim` and `group` +# are made available. + # Exception type for error thrown by the NetCDF library mutable struct NetCDFError <: Exception @@ -6,32 +9,18 @@ mutable struct NetCDFError <: Exception msg::String end -# base type of attributes list - -abstract type BaseAttributes -end - abstract type AbstractNCDataset <: AbstractDataset end abstract type AbstractNCVariable{T,N} <: AbstractVariable{T,N} end - -abstract type AbstractDimensions -end - -abstract type AbstractGroups -end - - # Variable (as stored in NetCDF file, without using # add_offset, scale_factor and _FillValue) mutable struct Variable{NetCDFType,N,TDS} <: AbstractNCVariable{NetCDFType, N} ds::TDS varid::Cint dimids::NTuple{N,Cint} -# attrib::Attributes{TDS} end mutable struct NCDataset{TDS} <: AbstractNCDataset where TDS <: Union{AbstractNCDataset,Nothing} @@ -130,7 +119,6 @@ end # view of subsets - struct SubVariable{T,N,TA,TI,TAttrib,TV} <: AbstractNCVariable{T,N} parent::TA indices::TI diff --git a/src/variable.jl b/src/variable.jl index cd44cb18..e613650c 100644 --- a/src/variable.jl +++ b/src/variable.jl @@ -222,8 +222,8 @@ end export dimnames -function dim(v::AbstractNCVariable,dimname::AbstractString) - if !(dimname in dimnames(v)) +function dim(v::AbstractNCVariable,dimname::SymbolOrString) + if !(String(dimname) in dimnames(v)) error("$dimname is not among the dimensions of $(name(v))") end return dim(dataset(v),dimname)