From 035d441249aaf47e224a9bafb1cd4074d8c45179 Mon Sep 17 00:00:00 2001 From: Fabian Gans Date: Fri, 23 Feb 2024 15:48:09 +0100 Subject: [PATCH] implement new diskarrays interface --- Project.toml | 2 +- src/NetCDF.jl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index 03b0cf1..83201f6 100644 --- a/Project.toml +++ b/Project.toml @@ -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" diff --git a/src/NetCDF.jl b/src/NetCDF.jl index 04f7bec..b495f2e 100644 --- a/src/NetCDF.jl +++ b/src/NetCDF.jl @@ -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") @@ -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}}