diff --git a/Project.toml b/Project.toml index 19af848..e49cbe3 100644 --- a/Project.toml +++ b/Project.toml @@ -34,7 +34,7 @@ Aqua = "0.8" ArchGDAL = "0.10.4" CairoMakie = "0.12" Colors = "0.12" -DimensionalData = "0.27.3" +DimensionalData = "0.29.5" DiskArrayEngine = "0.1.2" DiskArrayTools = "0.1.10" DiskArrays = "0.4.2" @@ -49,8 +49,8 @@ Proj = "1.7.1" Statistics = "1.10" Test = "1.10" TestItemRunner = "0.2.3" -YAXArrayBase = "0.6.1" -YAXArrays = "0.5.6" +YAXArrayBase = "0.7.5" +YAXArrays = "0.6.0" Zarr = "0.9.3" julia = "1.9" diff --git a/README.md b/README.md index e84f29a..8460a93 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,8 @@ savecube(elev, zarrpath) To reproduce the zooming example shown at the top of the README you can get the Above Ground Biomass here or try to load it from the cloud, but this might have some serious lag. ```julia -using YAXArrays, PyramidScheme +using YAXArrays +using PyramidScheme:PyramidScheme as PS using GLMakie p2020 = PS.Pyramid("https://s3.bgc-jena.mpg.de:9000/pyramids/ESACCI-BIOMASS-L4-AGB-MERGED-100m-2020-fv4.0.zarr") replacenan(nanval) = data -> <=(nanval)(data) ? NaN32 : Float32(data) diff --git a/src/PyramidScheme.jl b/src/PyramidScheme.jl index 5d4f519..a2bfbbb 100644 --- a/src/PyramidScheme.jl +++ b/src/PyramidScheme.jl @@ -55,9 +55,9 @@ end Pyramid(path::AbstractString) = Pyramid(path, YAB.backendfrompath(path)(path)) function Pyramid(path::AbstractString, backend) #This should rather be solved via dispatch, but this is not working because of Requires in YAXArrayBase. - if backend isa YAB.ZarrDataset + if (findfirst(x->x==:zarr,[keys(YAB.backendlist)...])!=nothing) && (typeof(backend) == YAB.backendfrompath("test.zarr")) _pyramid_zarr(path) - elseif backend isa YAB.GDALDataset + elseif (findfirst(x->x==:gdal,[keys(YAB.backendlist)...])!=nothing) && (typeof(backend) <: YAB.backendfrompath("test.tif")) _pyramid_gdal(path) else throw(ArgumentError(""" @@ -314,7 +314,8 @@ The data is aggregated with the specified `resampling_method`. Keyword arguments are forwarded to the `fill_pyramids` function. """ function buildpyramids(path::AbstractString; resampling_method=mean, recursive=true, runner=LocalRunner, verbose=false) - if YAB.backendfrompath(path) != YAB.ZarrDataset + # if YAB.backendfrompath(path) != YAB.ZarrDataset + if !(YAB.backendfrompath(path) <: YAB.backendfrompath("test.zarr")) throw(ArgumentError("$path is not a Zarr dataset therefore we can't build the Pyramids inplace")) end @@ -527,4 +528,4 @@ end include("broadcast.jl") -end \ No newline at end of file +end diff --git a/test/runtests.jl b/test/runtests.jl index 93bb8f1..7887dcd 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -45,6 +45,7 @@ end end @testitem "Pyramid building RGB eltype" begin + using DimensionalData using PyramidScheme: PyramidScheme as PS using Colors data = rand(RGB, 2000,2000)