Skip to content

Commit

Permalink
test writing of selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander-Barth committed Oct 19, 2023
1 parent deb6e7b commit 825ad5b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/test_select.jl
Original file line number Diff line number Diff line change
Expand Up @@ -399,3 +399,19 @@ data1 = NCDataset(fname) do ds
end;

@test data[Dates.month.(time) .== 1] == data1

ds = NCDataset(fname)
ds1 = NCDatasets.@select(ds,Dates.month(time) == 1)
outfname = tempname()
write(outfname,ds1)
close(ds)

ds = NCDataset(outfname)
@test all(Dates.month.(ds["time"][:]) .== 1)
close(ds)

ds = NCDataset(fname)
data1 = NCDatasets.@select(ds["data"],Dates.month(time) == 1)
t = data1["time"][:]
@test all(Dates.month.(t) .== 1)
close(ds)

0 comments on commit 825ad5b

Please sign in to comment.