Skip to content

Commit

Permalink
test ambiguities
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander-Barth committed Apr 29, 2024
1 parent 9fe0df9 commit 0d427c9
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 13 deletions.
8 changes: 1 addition & 7 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,4 @@ DataStructures = "0.17, 0.18"
DiskArrays = "0.3.22, 0.4"
JSON = "0.21"
Zarr = "0.9.2"
julia = "1"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
julia = "1.6"
2 changes: 1 addition & 1 deletion src/dataset.jl
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function ZarrDataset(url::AbstractString,mode = "r";
zg = zgroup(store, "",attrs = Dict(attrib))
iswritable = true
end
ZarrDataset(zg,parentdataset,dimensions,iswritable,maskingvalue)
ZarrDataset(parentdataset,zg,dimensions,iswritable,maskingvalue)
end


Expand Down
6 changes: 3 additions & 3 deletions src/types.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

struct ZarrVariable{T,N,TZA,TZG} <: CDM.AbstractVariable{T,N} where TZA <: AbstractArray{T,N}
struct ZarrVariable{T,N,TZA <: AbstractArray{T,N},TZG} <: CDM.AbstractVariable{T,N}
zarray::TZA
parentdataset::TZG
end

struct ZarrDataset{TZ,TP,Tmaskingvalue} <: CDM.AbstractDataset
struct ZarrDataset{TDS <: Union{CDM.AbstractDataset,Nothing},Tmaskingvalue,TZ} <: CDM.AbstractDataset
parentdataset::TDS
zgroup::TZ
parentdataset::TP
dimensions::OrderedDict{Symbol,Int}
iswritable::Bool
maskingvalue::Tmaskingvalue
Expand Down
4 changes: 2 additions & 2 deletions src/variable.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

Base.getindex(v::ZarrVariable,ij...) = v.zarray[ij...]
Base.getindex(v::ZarrVariable,ij::Union{Integer,Colon,AbstractVector{<:Integer}}...) = v.zarray[ij...]
CDM.load!(v::ZarrVariable,buffer,ij...) = buffer .= view(v.zarray,ij...)

function Base.setindex!(v::ZarrVariable,data,ij...)
function Base.setindex!(v::ZarrVariable,data,ij::Union{Integer,Colon,AbstractVector{<:Integer}}...)
v.zarray[ij...] = data
end
Base.size(v::ZarrVariable) = size(v.zarray)
Expand Down
2 changes: 2 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
[deps]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
CommonDataModel = "1fbeeb36-5f17-413c-809b-666fb144f157"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
DiskArrays = "3c3547ce-8d99-4f5e-a174-61eb10b00ae3"
NCDatasets = "85f8d34a-cbdd-5861-8df4-14fed0d494ab"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
Aqua = "0.8"
NCDatasets = "0.14"
julia = "1"
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ using ZarrDatasets
include("test_cdm.jl")
include("test_multifile.jl")
include("test_write.jl")
include("test_aqua.jl")
end
4 changes: 4 additions & 0 deletions test/test_aqua.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
using Aqua
using ZarrDatasets

Aqua.test_ambiguities(ZarrDatasets)

0 comments on commit 0d427c9

Please sign in to comment.