From 0936ef84c5fc7fc407785af6df041bf473e8fcd4 Mon Sep 17 00:00:00 2001 From: Alexander-Barth Date: Thu, 28 Mar 2024 12:12:24 +0100 Subject: [PATCH] test WOD --- Project.toml | 10 ++-------- test/runtests.jl | 1 + test/test_wod.jl | 26 ++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 test/test_wod.jl diff --git a/Project.toml b/Project.toml index e2ddadb..a90be22 100644 --- a/Project.toml +++ b/Project.toml @@ -4,7 +4,7 @@ keywords = ["physical-oceanography", "sea-water", "julia", "density", "fluxes", license = "LGPL" desc = "Utility functions for physical oceanography" author = ["Alexander Barth", "Jean-Marie Beckers", "Charles Troupin", "Aida Alvera Azcarate"] -version = "0.6.9" +version = "0.6.10" [deps] AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" @@ -24,11 +24,5 @@ Glob = "1" Gumbo = "0.5, 0.7, 0.8" HTTP = "0.8, 0.9, 1" Missings = "0.4, 1" -NCDatasets = "0.8, 0.9, 0.10, 0.11, 0.12, 0.13, 0.14" +NCDatasets = "0.13, 0.14" julia = "1" - -[extras] -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" - -[targets] -test = ["Test"] diff --git a/test/runtests.jl b/test/runtests.jl index aa2b1a3..dcbea46 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -224,5 +224,6 @@ using Statistics include("test_cmems.jl") include("test_argo.jl") + include("test_wod.jl") include("test_tides.jl") end diff --git a/test/test_wod.jl b/test/test_wod.jl new file mode 100644 index 0000000..a786343 --- /dev/null +++ b/test/test_wod.jl @@ -0,0 +1,26 @@ + +using ZipFile +using Downloads: download +using PhysOcean: WorldOceanDatabase +using Test + +tmpfname = download("https://dox.uliege.be/index.php/s/QBFPUJvOMGOlOvS/download") +woddir = tempname() +mkdir(woddir) + +zarchive = ZipFile.Reader(tmpfname) +for f in zarchive.files + fullpath = joinpath(woddir,f.name) + if (endswith(f.name,"/") || endswith(f.name,"\\")) + mkdir(fullpath) + else + write(fullpath, read(f)) + end +end +close(zarchive) + + +obsvalue,obslon,obslat,obsdepth,obstime,obsid = WorldOceanDatabase.load( + Float64,woddir,"Temperature"; prefixid = "1977-") + +@test length(obsvalue) == 7298