Skip to content

Commit 415f175

Browse files
authored
Merge pull request #39 from JuliaAstro/tolerance
Reduce tolerance for all tests to 1e-8
2 parents 80dd450 + 1023650 commit 415f175

File tree

8 files changed

+35
-35
lines changed

8 files changed

+35
-35
lines changed

test/test-iqbal.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ end
4949
# end
5050
#
5151
# res = solar_position(obs, dt, Iqbal())
52-
# @test isapprox(res.elevation, exp_elev, atol = 1e-6)
53-
# @test isapprox(res.zenith, exp_zen, atol = 1e-6)
54-
# @test isapprox(res.azimuth, exp_az, atol = 1e-6)
52+
# @test isapprox(res.elevation, exp_elev, atol = 1e-8)
53+
# @test isapprox(res.zenith, exp_zen, atol = 1e-8)
54+
# @test isapprox(res.azimuth, exp_az, atol = 1e-8)
5555
# end
5656
end
5757
end

test/test-mtk.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ using CairoMakie
8787
@test length(zenith_vals) == length(sol.t)
8888

8989
# Check that zenith ≈ 90 - elevation
90-
@test all(isapprox.(zenith_vals, 90 .- elevation_vals; atol = 1e-6))
90+
@test all(isapprox.(zenith_vals, 90 .- elevation_vals; atol = 1e-8))
9191

9292
# For summer solstice in San Francisco, check that:
9393
# 1. The sun rises (elevation goes from negative to positive)
@@ -201,14 +201,14 @@ using CairoMakie
201201
@test isapprox(
202202
sol[sys.elevation][1],
203203
row.apparent_elevation,
204-
atol = 1e-6,
204+
atol = 1e-8,
205205
)
206-
@test isapprox(sol[sys.zenith][1], row.apparent_zenith, atol = 1e-6)
206+
@test isapprox(sol[sys.zenith][1], row.apparent_zenith, atol = 1e-8)
207207
else
208-
@test isapprox(sol[sys.elevation][1], row.elevation, atol = 1e-6)
209-
@test isapprox(sol[sys.zenith][1], row.zenith, atol = 1e-6)
208+
@test isapprox(sol[sys.elevation][1], row.elevation, atol = 1e-8)
209+
@test isapprox(sol[sys.zenith][1], row.zenith, atol = 1e-8)
210210
end
211-
@test isapprox(sol[sys.azimuth][1], row.azimuth, atol = 1e-6)
211+
@test isapprox(sol[sys.azimuth][1], row.azimuth, atol = 1e-8)
212212
end
213213
end
214214
end

test/test-noaa.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
res = solar_position(obs, dt, NOAA(), HUGHES(101325.0, 10.0))
2929

3030
# azimuth calculations have small variations
31-
@test isapprox(res.elevation, exp_elev, atol = 2e-7)
32-
@test isapprox(res.zenith, exp_zen, atol = 2e-7)
33-
@test isapprox(res.azimuth, exp_az, atol = 3e-7)
34-
@test isapprox(res.apparent_elevation, exp_app_elev, atol = 2e-7)
35-
@test isapprox(res.apparent_zenith, exp_app_zen, atol = 2e-7)
31+
@test isapprox(res.elevation, exp_elev, atol = 1e-8)
32+
@test isapprox(res.zenith, exp_zen, atol = 1e-8)
33+
@test isapprox(res.azimuth, exp_az, atol = 1e-8)
34+
@test isapprox(res.apparent_elevation, exp_app_elev, atol = 1e-8)
35+
@test isapprox(res.apparent_zenith, exp_app_zen, atol = 1e-8)
3636
end
3737
end
3838

test/test-psa.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
end
2323

2424
res = solar_position(obs, dt, PSA(i))
25-
@test isapprox(res.elevation, exp_elev, atol = 1e-6)
26-
@test isapprox(res.zenith, exp_zen, atol = 1e-6)
27-
@test isapprox(res.azimuth, exp_az, atol = 1e-6)
25+
@test isapprox(res.elevation, exp_elev, atol = 1e-8)
26+
@test isapprox(res.zenith, exp_zen, atol = 1e-8)
27+
@test isapprox(res.azimuth, exp_az, atol = 1e-8)
2828
end
2929
end
3030

test/test-refraction.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,14 @@ elevations = test_elevation_angles()
8888
@testset "Scalar computation" begin
8989
for (i, elev) in enumerate(elevations)
9090
result = refraction(algorithm, elev)
91-
@test result expected[i] atol = 1e-7
91+
@test result expected[i] atol = 1e-8
9292
end
9393
end
9494

9595
@testset "Vectorized computation" begin
9696
results = refraction.(Ref(algorithm), elevations)
9797
for (i, res) in enumerate(results)
98-
@test res expected[i] atol = 1e-7
98+
@test res expected[i] atol = 1e-8
9999
end
100100
end
101101
end

test/test-spa.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
# SPA includes refraction correction and equation of time
2020
res = solar_position(obs, dt, SPA())
2121

22-
@test isapprox(res.elevation, row.elevation, atol = 1e-6)
23-
@test isapprox(res.zenith, row.zenith, atol = 1e-6)
24-
@test isapprox(res.azimuth, row.azimuth, atol = 1e-6)
25-
@test isapprox(res.apparent_elevation, row.apparent_elevation, atol = 1e-6)
26-
@test isapprox(res.apparent_zenith, row.apparent_zenith, atol = 1e-6)
27-
@test isapprox(res.equation_of_time, row.equation_of_time, atol = 1e-6)
22+
@test isapprox(res.elevation, row.elevation, atol = 1e-8)
23+
@test isapprox(res.zenith, row.zenith, atol = 1e-8)
24+
@test isapprox(res.azimuth, row.azimuth, atol = 1e-8)
25+
@test isapprox(res.apparent_elevation, row.apparent_elevation, atol = 1e-8)
26+
@test isapprox(res.apparent_zenith, row.apparent_zenith, atol = 1e-8)
27+
@test isapprox(res.equation_of_time, row.equation_of_time, atol = 1e-8)
2828
end
2929
end
3030

@@ -67,7 +67,7 @@
6767
@test !isapprox(
6868
res_default.apparent_elevation,
6969
res_custom.apparent_elevation,
70-
atol = 1e-6,
70+
atol = 1e-8,
7171
)
7272

7373
@test isapprox(res_default.elevation, res_custom.elevation, atol = 1e-10)

test/test-usno.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919

2020
res = solar_position(obs, dt, USNO())
2121

22-
@test isapprox(res.elevation, exp_elev, atol = 1e-6)
23-
@test isapprox(res.zenith, exp_zen, atol = 1e-6)
24-
@test isapprox(res.azimuth, exp_az, atol = 1e-6)
22+
@test isapprox(res.elevation, exp_elev, atol = 1e-8)
23+
@test isapprox(res.zenith, exp_zen, atol = 1e-8)
24+
@test isapprox(res.azimuth, exp_az, atol = 1e-8)
2525
end
2626
end
2727

@@ -39,9 +39,9 @@
3939

4040
res = solar_position(obs, dt, USNO(67.0, 2))
4141

42-
@test isapprox(res.elevation, exp_elev, atol = 1e-6)
43-
@test isapprox(res.zenith, exp_zen, atol = 1e-6)
44-
@test isapprox(res.azimuth, exp_az, atol = 1e-6)
42+
@test isapprox(res.elevation, exp_elev, atol = 1e-8)
43+
@test isapprox(res.zenith, exp_zen, atol = 1e-8)
44+
@test isapprox(res.azimuth, exp_az, atol = 1e-8)
4545
end
4646
end
4747

test/test-walraven.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
end
1818

1919
res = solar_position(obs, dt, Walraven())
20-
@test isapprox(res.elevation, exp_elev, atol = 1e-6)
21-
@test isapprox(res.zenith, exp_zen, atol = 1e-6)
22-
@test isapprox(res.azimuth, exp_az, atol = 1e-6)
20+
@test isapprox(res.elevation, exp_elev, atol = 1e-8)
21+
@test isapprox(res.zenith, exp_zen, atol = 1e-8)
22+
@test isapprox(res.azimuth, exp_az, atol = 1e-8)
2323
end
2424

2525
@testset "Walraven edge cases" begin

0 commit comments

Comments
 (0)