diff --git a/README.md b/README.md index c33dbd0..a0fe609 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # ZarrDatasets -[![Build Status](https://github.com/JuliaGeo/ZarrDatasets.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/JuliaGeo/ZarrDatasets.jl/actions/workflows/CI.yml?query=branch%3Amain) [![Build Status](https://github.com/JuliaGeo/ZarrDatasets.jl/workflows/CI/badge.svg)](https://github.com/JuliaGeo/ZarrDatasets.jl/actions) [![codecov.io](http://codecov.io/github/JuliaGeo/ZarrDatasets.jl/coverage.svg?branch=main)](http://app.codecov.io/github/JuliaGeo/ZarrDatasets.jl?branch=main) [![documentation dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://juliageo.github.io/ZarrDatasets.jl/dev/) @@ -9,7 +8,7 @@ ZarrDatasets.jl is a julia package to read [Zarr](https://zarr.dev/) datasets using the native julia implementation [Zarr.jl](https://github.com/JuliaIO/Zarr.jl) using the [CommonDataModel.jl](https://github.com/JuliaGeo/CommonDataModel.jl) interface. -In the following example data from [Copernicus marine service](https://marine.copernicus.eu/) are loaded using `ZarrDatasets` and a subset +In the following example, data from [Copernicus Marine Service](https://marine.copernicus.eu/) is loaded using `ZarrDatasets` and a subset is saved as a NetCDF file: diff --git a/src/dataset.jl b/src/dataset.jl index 04bdebd..4396595 100644 --- a/src/dataset.jl +++ b/src/dataset.jl @@ -57,7 +57,7 @@ CDM.group(ds::ZarrDataset,name::SymbolOrString) = ZarrDataset(ds.zgroup.groups,S CDM.parentdataset(ds::ZarrDataset) = ds.parentdataset -CDM.iswritable(ds::ZarrDataset) = true +CDM.iswritable(ds::ZarrDataset) = false CDM.maskingvalue(ds::ZarrDataset) = ds.maskingvalue diff --git a/test/Project.toml b/test/Project.toml index 9e60b1e..5c95be8 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -1,8 +1,9 @@ [deps] +CommonDataModel = "1fbeeb36-5f17-413c-809b-666fb144f157" Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" NCDatasets = "85f8d34a-cbdd-5861-8df4-14fed0d494ab" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [compat] -julia = "1" NCDatasets = "0.14" +julia = "1" diff --git a/test/runtests.jl b/test/runtests.jl index a6d901d..79f2631 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -2,6 +2,7 @@ using Dates using NCDatasets using Test using ZarrDatasets +using CommonDataModel: iswritable, attribnames, parentdataset @testset "ZarrDatasets.jl" begin #fname = "/tmp/foo.zarr" @@ -44,6 +45,15 @@ using ZarrDatasets @test ds2.attrib[attribname] == attribval end + io = IOBuffer() + show(io,ds) + str = String(take!(io)) + @test occursin("title",str) + + @test !iswritable(ds) + @test "title" in attribnames(ds) + @test isnothing(parentdataset(ds)) + close(ds) close(ds2) end