Skip to content

Commit

Permalink
implement new diskarrays interface
Browse files Browse the repository at this point in the history
  • Loading branch information
meggart committed Feb 23, 2024
1 parent 0c9f878 commit 035d441
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Formatting = "59287772-0a20-5a39-b81b-1366585eb4c0"
NetCDF_jll = "7243133f-43d8-5620-bbf4-c2c921802cf3"

[compat]
DiskArrays = "0.3"
DiskArrays = "0.3, 0.4"
Formatting = "0.3.2, 0.4"
NetCDF_jll = "400.902.5"
julia = "1.6"
Expand Down
4 changes: 2 additions & 2 deletions src/NetCDF.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using NetCDF_jll
using Formatting
using Base.Cartesian
import DiskArrays: readblock!, writeblock!, AbstractDiskArray, eachchunk, GridChunks,
estimate_chunksize, haschunks, Chunked, Unchunked
estimate_chunksize, haschunks, Chunked, Unchunked, SubRanges

include("netcdf_constants.jl")
include("netcdf_c.jl")
Expand Down Expand Up @@ -230,7 +230,7 @@ getchunksize(v::NcVar) = getchunksize(haschunks(v),v)
getchunksize(::Chunked, v::NcVar) = GridChunks(v,reverse(map(Int64,v.chunksize)))
getchunksize(::Unchunked, v::NcVar) = estimate_chunksize(v)
eachchunk(v::NcVar) = getchunksize(v)
haschunks(v::NcVar) = all(iszero,v.chunksize) ? Unchunked() : Chunked()
haschunks(v::NcVar) = all(iszero,v.chunksize) ? Unchunked(SubRanges()) : Chunked()

"""
NcVar(name::AbstractString,dimin::Union{NcDim,Array{NcDim,1}}
Expand Down

0 comments on commit 035d441

Please sign in to comment.