Skip to content

Commit

Permalink
Allow Corrd[Lat[...]] index (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
Datseris committed Jan 14, 2022
1 parent 990ef8e commit d14283c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ClimateBase"
uuid = "35604d93-0fb8-4872-9436-495b01d137e2"
authors = ["Datseris <[email protected]>", "Philippe Roy <[email protected]>"]
version = "0.14.1"
version = "0.14.2"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand All @@ -15,7 +15,7 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"

[compat]
DimensionalData = "0.20"
DimensionalData = "0.20.1"
Interpolations = "0.13.2"
NCDatasets = "0.10, 0.11"
Requires = "1"
Expand Down
11 changes: 4 additions & 7 deletions test/space_coord_tests.jl
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
@testset "Spatial Coordinates Tests" begin
@testset "Indexing and Basics" begin
# Needs https://github.com/rafaqz/DimensionalData.jl/issues/357
# subsel = C[Lat(0..8)]
# @test hasdim(subsel, Coord)
# @test size(subsel, Coord) < size(C, Coord)
# @test all(0 ≤ c[2] ≤ 8 for c in gnv(dims(subsel, Coord)))
subsel = C[Coord(Lat(0..8))]
@test hasdim(subsel, Coord)
@test size(subsel, Coord) < size(C, Coord)
@test all(0 c[2] 8 for c in gnv(dims(subsel, Coord)))

@test length(collect(spatialidxs(C))) == size(C, Coord)

Atran = transform_to_coord(A)
@test hasdim(Atran, Coord)
@test lons == sort!(unique!([c[1] for c in gnv(dims(Atran, Coord))]))

end

@testset "Zonal mean" begin
Expand Down Expand Up @@ -45,5 +43,4 @@
# TODO: test actual numeric values
end


end

0 comments on commit d14283c

Please sign in to comment.