Skip to content

Commit

Permalink
increase codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
gaelforget committed Sep 11, 2024
1 parent 472edef commit 443a022
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 2 deletions.
7 changes: 6 additions & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
[deps]
[deps]
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
DataDeps = "124859b0-ceae-595e-8997-d05f6a7a8dfe"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
Proj = "c94c279d-25a6-4763-9509-64d165bea63e"
Shapefile = "8e980c4a-a4fe-5da2-b3a7-4b4b0353a2f4"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
45 changes: 44 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Test, Documenter
using MeshArrays
using MeshArrays, DataDeps, CairoMakie, JLD2, Shapefile, Proj

MeshArrays.GRID_LL360_download()
MeshArrays.GRID_LLC90_download()
Expand Down Expand Up @@ -169,6 +169,49 @@ end
@test isfile(tmp)
end

@testset "Plotting:" begin
γ=GridSpec("LatLonCap",MeshArrays.GRID_LLC90)
Γ=GridLoad(γ;option="light")
D=Γ.Depth
λ=interpolation_setup()

fig=MeshArrays.plot_examples(:smoothing_demo,D,D)
(fig1,fig2,fig3)=MeshArrays.plot_examples(:interpolation_demo,Γ)

MeshArrays.plot_examples(:meriodional_overturning,Γ,rand(179,50))
MeshArrays.plot_examples(:northward_transport,rand(179))

MeshArrays.plot_examples(:gradient_EN,λ,D,D)
MeshArrays.plot_examples(:gradient_xy,λ,D,D)

## more methods

scatter.XC,Γ.YC,color=:black)
heatmap(D,interpolation=λ)
scatter!(current_axis(),Γ.XC,Γ.YC,color=:red)

heatmap(D) #will display tile by tile
heatmap(D,interpolation=λ,title="ocean depth") #same but w title

lon0=-160
proj=Proj.Transformation(MA_preset=2,lon0=lon0)
Dint=reshape(Interpolate(D,λ.f,λ.i,λ.j,λ.w),size.lon))

fil=demo.download_polygons("ne_110m_admin_0_countries.shp")
# fil=demo.download_polygons("countries.geojson")
pol=MeshArrays.read_polygons(fil)

f = Figure()
ax = f[1, 1] = Axis(f, aspect = DataAspect(), title = "Ocean Depth (m)")
pr_ax=MeshArrays.ProjAxis(ax; proj=proj,lon0=lon0)
surf = surface!(pr_ax,λ.lon,λ.lat,0*λ.lat; color=Dint,
colorrange=(0.0,6000.0), colormap=:berlin, shading = NoShading)
lines!(pr_ax; polygons=pol,color=:black,linewidth=0.5)
MeshArrays.grid_lines!(pr_ax;color=:lightgreen,linewidth=0.5)
f

end

@testset "doctests" begin
doctest(MeshArrays; manual = false)
end

0 comments on commit 443a022

Please sign in to comment.