Skip to content

Commit

Permalink
Implement DiskArrays 0.4 interface (#189)
Browse files Browse the repository at this point in the history
* implement new diskarrays interface

* Dont support 0.3

* Drop 1.6 support
  • Loading branch information
meggart authored May 22, 2024
1 parent e434be6 commit 4ba1f88
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ jobs:
fail-fast: false
matrix:
version:
- '1.6'
- '1'
- 'nightly'
os:
Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ DiskArrays = "3c3547ce-8d99-4f5e-a174-61eb10b00ae3"
NetCDF_jll = "7243133f-43d8-5620-bbf4-c2c921802cf3"

[compat]
DiskArrays = "0.3"
DiskArrays = "0.4"
NetCDF_jll = "400.902.5"
julia = "1.6"
julia = "1.10"

[extras]
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Expand Down
4 changes: 2 additions & 2 deletions src/NetCDF.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module NetCDF
using NetCDF_jll
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 @@ -229,7 +229,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 4ba1f88

Please sign in to comment.