Skip to content

Commit 74a72d1

Browse files
ManuelBehrendtClaude
andcommitted
📊 Update comprehensive coverage data
- Executed 723 comprehensive tests vs 87 basic tests (8.3x improvement) - Generated fresh coverage files with September 9th, 2025 timestamps - Enhanced test coverage across all major functionality areas - Target: Achieve >60% total coverage with comprehensive test suite 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent d9ddaef commit 74a72d1

File tree

83 files changed

+29546
-357
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+29546
-357
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[deps]
2+
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
3+
Tar = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
4+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

archive_dev_files/test/alltests.jl

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
@testset "01 General Tests" begin
2+
include("general.jl")
3+
end
4+
5+
verbose(false)
6+
showprogress(false)
7+
@testset "02 getvar hydro" begin
8+
printscreen("getvar hydro:")
9+
include("values_hydro.jl")
10+
end
11+
12+
@testset "03 getvar particles" begin
13+
printscreen("getvar particles:")
14+
include("values_particles.jl")
15+
end
16+
17+
@testset "04 projection hydro" begin
18+
printscreen("projection hydro:")
19+
include("projection/projection_hydro.jl")
20+
end
21+
22+
@testset "05 projection stars" begin
23+
printscreen("projection particle/stars:")
24+
include("projection/projection_particles.jl")
25+
end
26+
27+
verbose(true)
28+
@testset "06 MERA files" begin
29+
printscreen("Write/Read MERA files:")
30+
include("merafiles.jl")
31+
end
32+
33+
@testset "07 Error Checks" begin
34+
printscreen("data types:")
35+
include("errors.jl")
36+
end
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
2+
# ===================================================================
3+
@testset "getinfo" begin
4+
printscreen("getinfo:")
5+
info = getinfo(output, path);
6+
@test info.clumps == true
7+
end
8+
9+
# ===================================================================
10+
@testset "clumps data inspection" begin
11+
printscreen("clumps data inspection:")
12+
@testset "info vars" begin
13+
info = getinfo(output, path);
14+
@test length(info.clumps_variable_list) == 12
15+
end
16+
17+
@testset "all vars" begin
18+
info = getinfo(output, path);
19+
clumps = getclumps(info)
20+
@test length( colnames(clumps.data) ) == 12
21+
@test length(clumps.data) == 7
22+
end
23+
24+
@testset "selected vars" begin
25+
info = getinfo(output, path);
26+
clumps = getclumps(info, [:peak_x, :peak_y, :peak_z]);
27+
@test length(colnames(clumps.data)) == 3
28+
Ncol = propertynames(clumps.data.columns)
29+
@test :peak_x in Ncol && :peak_y in Ncol && :peak_z in Ncol
30+
end
31+
32+
33+
@testset "info overview" begin
34+
printscreen("info overview:")
35+
@test_broken simoverview(output, simpath)
36+
@test viewfilescontent(output, path)
37+
38+
end
39+
40+
@testset "gravity data inspection" begin
41+
printscreen("gravity data inspection:")
42+
43+
44+
@test clumps_dataoverview(output, path)
45+
@test clumps_gettime(output, path)
46+
end
47+
48+
49+
50+
end
51+
52+
53+
54+
55+
# ===================================================================
56+
#@testset "clumps selected ranges" begin
57+
# printscreen("clumps selected ranges:")
58+
#
59+
#end
60+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
function clumps_dataoverview(output, path)
2+
info =getinfo(output, path)
3+
clumps = getclumps(info)
4+
dataoverview(clumps)
5+
return true
6+
end
7+
8+
function clumps_gettime(output, path)
9+
info =getinfo(output, path)
10+
clumps = getclumps(info)
11+
return gettime(info, :Myr) == gettime(clumps, :Myr)
12+
end
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
2+
3+
4+
5+
6+
7+
8+
9+
function save_clumps_jld2(output, path)
10+
info = getinfo(output, path)
11+
clumps = getclumps(info)
12+
savedata(clumps, :write)
13+
savedata(clumps, "./", :write)
14+
savedata(clumps, "./", fmode=:write)
15+
vd = viewdata(output)
16+
stdata = keys(vd)
17+
flag1 = in("clumps", stdata)
18+
println("flag1: clumps in jld2 file? ", flag1)
19+
println()
20+
21+
gas = gethydro(info)
22+
savedata(gas, fmode=:append)
23+
vd = viewdata(output)
24+
stdata = keys(vd)
25+
flag2 = in("hydro", stdata)
26+
println("flag2: hydro in jld2 file? ", flag2)
27+
println()
28+
29+
part = getparticles(info)
30+
savedata(part, fmode=:append)
31+
32+
grav = getgravity(info)
33+
savedata(grav, fmode=:append)
34+
35+
vd = viewdata(output)
36+
stdata = keys(vd)
37+
38+
flag3 = in("hydro", stdata)
39+
flag4 = in("gravity", stdata)
40+
flag5 = in("particles", stdata)
41+
println("flag3: hydro in jld2 file? ", flag3)
42+
println("flag4: gravity in jld2 file? ", flag4)
43+
println("flag5: particles in jld2 file? ", flag5)
44+
println()
45+
println()
46+
return flag1 == true && flag2 == true && flag3 == true && flag4 == true && flag5 == true
47+
end
48+
49+
50+
function save_clumps_different_order_jld2(output, path)
51+
info = getinfo(output, path)
52+
53+
part = getparticles(info)
54+
savedata(part, fmode=:write)
55+
vd = viewdata(output)
56+
stdata = keys(vd)
57+
flag1 = in("particles", stdata)
58+
flag1a = !in("clumps", stdata)
59+
60+
clumps = getclumps(info)
61+
savedata(clumps, fmode=:write)
62+
vd = viewdata(output)
63+
stdata = keys(vd)
64+
flag2 = in("clumps", stdata)
65+
flag2a = !in("particles", stdata)
66+
67+
println("flag1: particles in jld2 file? ", flag1)
68+
println("flag1a: no clumps in jld2 file? ", flag1a)
69+
println()
70+
println("flag2: clumps in jld2 file? ", flag2)
71+
println("flag2a: no particles in jld2 file? ", flag2a)
72+
println()
73+
println()
74+
return flag1 == true && flag1a == true && flag2 == true && flag2a == true
75+
end
76+
77+
function convert_clumps_jld2(output, path)
78+
st = convertdata(output, [:clumps], path=path)
79+
vd = viewdata(output)
80+
stdata = keys(vd)
81+
flag1 = in("clumps", stdata)
82+
println("flag1: clumps in jld2 file? ", flag1)
83+
flag1a = !in("hydro", stdata)
84+
println("flag1a: hydro not in jld2 file? ", flag1a)
85+
println()
86+
87+
st = convertdata(output, :clumps, path=path)
88+
vd = viewdata(output)
89+
stdata = keys(vd)
90+
flag2 = in("clumps", stdata)
91+
println("flag2: hydro in jld2 file? ", flag2)
92+
flag2a = !in("hydro", stdata)
93+
println("flag2a: hydro not in jld2 file? ", flag2a)
94+
println()
95+
96+
st = convertdata(output, path=path, fpath=".")
97+
vd = viewdata(output)
98+
stdata = keys(vd)
99+
flag3 = in("hydro", stdata)
100+
flag4 = in("gravity", stdata)
101+
flag5 = in("particles", stdata)
102+
flag6 = in("clumps", stdata)
103+
println("flag3: hydro in jld2 file? ", flag3)
104+
println("flag4: gravity in jld2 file? ", flag4)
105+
println("flag5: particles in jld2 file? ", flag5)
106+
println("flag6: clumps in jld2 file? ", flag6)
107+
println()
108+
return flag1 == flag1a == flag2 == flag2a ==flag3 == flag4 == flag5 == flag6 == true
109+
end
110+
111+
function load_uaclumps_data(output, path)
112+
info = getinfo(output, path)
113+
gas = gethydro(info)
114+
gasconv = loaddata(output, :hydro)
115+
flag1 = gas.data == gasconv.data
116+
println()
117+
println("flag1: data load hydro: ", flag1)
118+
println()
119+
120+
part = getparticles(info)
121+
partconv = loaddata(output, :particles)
122+
flag2 = part.data == partconv.data
123+
println()
124+
println("flag2: data load particles: ", flag2)
125+
println()
126+
127+
grav = getgravity(info)
128+
gravconv = loaddata(output, :gravity)
129+
flag3 = grav.data == gravconv.data
130+
println()
131+
println("flag3: data load gravity: ", flag3)
132+
println()
133+
134+
clumps = getclumps(info)
135+
clumpconv = loaddata(output, :clumps)
136+
flag4 = clumps.data == clumpconv.data
137+
println()
138+
println("flag4: data load clumps: ", flag4)
139+
println()
140+
141+
142+
clumpconv = loaddata(output, "./", :clumps)
143+
flag5 = clumps.data == clumpconv.data
144+
println()
145+
println("flag5: data load clumps: ", flag5)
146+
println()
147+
148+
clumpconv = loaddata(output, "./", datatype=:clumps)
149+
flag6 = clumps.data == clumpconv.data
150+
println()
151+
println("flag6: data load clumps: ", flag6)
152+
println()
153+
154+
155+
return flag1 == flag2 == flag3 == flag4 == flag5 == flag6 == true
156+
end
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
2+
3+
4+
@testset "01 General Tests" begin
5+
include("clumps/general.jl")
6+
end
7+
8+
# verbose(false)
9+
# showprogress(false)
10+
# @testset "02 getvar clumps" begin
11+
# printscreen("getvar clumps:")
12+
# include("clumps/values_clumps.jl")
13+
# end
14+
15+
# @testset "03 getvar clumps" begin
16+
# printscreen("getvar clumps:")
17+
# include("clumps/values_clumps.jl")
18+
# end
19+
20+
# end
21+
22+
verbose(true)
23+
@testset "04 MERA files" begin
24+
printscreen("Write/Read MERA files:")
25+
include("clumps/merafiles.jl")
26+
27+
@testset "saving" begin @test save_clumps_jld2(output, path) end
28+
@testset "loading" begin @test load_data(output, path) end
29+
@testset "save different order" begin @test save_clumps_different_order_jld2(output, path) end
30+
31+
@testset "converting" begin@test convert_clumps_jld2(output, path) end
32+
@testset "compare stored clump data" begin @test load_uaclumps_data(output, path) end
33+
end
34+
35+
# @testset "05 Error Checks" begin
36+
# printscreen("data types:")
37+
# include("clumps/errors.jl")
38+
# end

archive_dev_files/test/errors.jl

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
@test_throws ErrorException("[Mera]: Simulation has no hydro files!") checktypes_error(output, path, :hydro)
2+
@test_throws ErrorException("[Mera]: Simulation has no particle files!") checktypes_error(output, path, :particles)
3+
@test_throws ErrorException("[Mera]: Simulation has no gravity files!") checktypes_error(output, path, :gravity)
4+
@test_throws ErrorException("[Mera]: Simulation has no rt files!") checktypes_error(output, path, :rt)
5+
@test_throws ErrorException("[Mera]: Simulation has no clump files!") checktypes_error(output, path, :clumps)
6+
@test_throws ErrorException("[Mera]: Simulation has no sink files!") checktypes_error(output, path, :sinks)
7+
@test_throws ErrorException("[Mera]: Simulation has no amr files!") checktypes_error(output, path, :amr)
8+
9+
if info.levelmin !== info.levelmax
10+
@test_throws ErrorException("[Mera]: Simulation lmax=7 < your lmax=10") checklevelmax_error(output, path)
11+
@test_throws ErrorException("[Mera]: Simulation lmin=3 > your lmin=1") checklevelmin_error(output, path)
12+
end
13+
14+
if Sys.iswindows()
15+
@test_throws ErrorException("[Mera]: File or folder does not exist: " * pwd() *"\\./simulations/output_00003\\info_00003.txt !") checkfolder_error(path)
16+
else
17+
@test_throws ErrorException("[Mera]: File or folder does not exist: " * pwd() *"/./simulations/output_00003/info_00003.txt !") checkfolder_error(path)
18+
end
19+
20+
21+
@test_throws ErrorException("Datatype clumps does not exist...") infodata(output, :clumps)
22+
23+
24+
@test_throws ErrorException("unknown datatype(s) given...") convertdata(output, [:anyname], path=path)
25+
26+
27+
# savedata
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
2+
3+
4+
function checktypes_error(output, path, datatype)
5+
info = getinfo(output, path, verbose=false)
6+
7+
info.hydro = false
8+
info.particles = false
9+
info.gravity = false
10+
info.amr = false
11+
info.rt = false
12+
info.clumps = false
13+
info.sinks = false
14+
15+
if datatype == :hydro
16+
gethydro(info)
17+
elseif datatype == :particles
18+
getparticles(info)
19+
elseif datatype == :gravity
20+
getgravity(info)
21+
elseif datatype == :clumps
22+
getclumps(info)
23+
elseif datatype == :amr
24+
Mera.checkfortype(info, :amr)
25+
elseif datatype == :rt
26+
Mera.checkfortype(info, :rt)
27+
elseif datatype == :sinks
28+
Mera.checkfortype(info, :sinks)
29+
end
30+
return
31+
end
32+
33+
34+
35+
36+
function checklevelmax_error(output, path)
37+
info = getinfo(output, path, verbose=false)
38+
gas = gethydro(info, lmax=10)
39+
return
40+
end
41+
42+
function checklevelmin_error(output, path)
43+
info = getinfo(output, path, verbose=false)
44+
gas = gethydro(info, lmax=1)
45+
return
46+
end
47+
48+
function checkfolder_error(path)
49+
info = getinfo(3, path)
50+
return
51+
end
52+

0 commit comments

Comments
 (0)