Skip to content

Commit

Permalink
Minor docs improvements
Browse files Browse the repository at this point in the history
Just a little extra formatting plus cross-reference to docs for `cfvariable`. (Found while looking for docs on `DateTimeNoLeap`.)
  • Loading branch information
glwagner authored Nov 1, 2023
1 parent d589989 commit 0cbe937
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/cfvariable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ end
export cfvariable

"""
v = getindex(ds::NCDataset,varname::AbstractString)
v = getindex(ds::NCDataset, varname::AbstractString)
Return the NetCDF variable `varname` in the dataset `ds` as a
`NCDataset.CFVariable`. The following CF convention are honored when the
Expand All @@ -254,10 +254,10 @@ variable is indexed:
`DateTime` object. Note that `DateTimeAllLeap`, `DateTimeNoLeap` and
`DateTime360Day` cannot be converted to the proleptic gregorian calendar used in
julia and are returned as such. If a calendar is defined but not among the
ones specified in the CF convention, then the data in the NetCDF file is not
converted into a date structure.
ones specified in the CF convention, then the data in the NetCDF file is not
converted into a date structure.
A call `getindex(ds,varname)` is usually written as `ds[varname]`.
A call `getindex(ds, varname)` is usually written as `ds[varname]`.
If variable represents a cell boundary, the attributes `calendar` and `units` of the related NetCDF variables are used, if they are not specified. For example:
Expand All @@ -276,14 +276,12 @@ variables:
In this case, the variable `time_bnds` uses the units and calendar of `time`
because both variables are related thought the bounds attribute following the CF conventions.
See also cfvariable
See also [`cfvariable(ds, varname)`](@ref).
"""
function Base.getindex(ds::AbstractNCDataset,varname::SymbolOrString)
return cfvariable(ds, varname)
end



"""
dimnames(v::CFVariable)
Expand Down

0 comments on commit 0cbe937

Please sign in to comment.