Skip to content

Commit

Permalink
Update doctests to Julia ≥ v1.6 with aliased type printing
Browse files Browse the repository at this point in the history
  • Loading branch information
jmert committed Dec 11, 2021
1 parent 8d533d2 commit 236cac3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/src/man/healpix.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ The corresponding vector for a given pixel is retrieved with
[`CMB.Healpix.pix2vec`](@ref).
```jldoctest healpix
julia> pix2vec(nside, 103)
3-element StaticArrays.SArray{Tuple{3},Float64,1,3} with indices SOneTo(3):
3-element StaticArrays.SVector{3, Float64} with indices SOneTo(3):
0.9807852804032304
-0.19509032201612828
0.0
Expand Down
4 changes: 2 additions & 2 deletions docs/src/man/sphere.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ julia> latlon(θ, ϕ) # colat-az to lat-lon
(44.97531, -93.23471)
julia> r = cartvec(θ, ϕ) # colat-az to unit vector
3-element StaticArrays.SArray{Tuple{3},Float64,1,3} with indices SOneTo(3):
3-element StaticArrays.SVector{3, Float64} with indices SOneTo(3):
-0.03991664732478908
-0.7062843499648845
0.7068020078218715
Expand Down Expand Up @@ -148,7 +148,7 @@ Given the angular distance `σ` and bearing `α₁` from before, we can reconstr
julia> using LinearAlgebra: dot
julia> reckon(r₁, σ, α₁)
3-element StaticArrays.SArray{Tuple{3},Float64,1,3} with indices SOneTo(3):
3-element StaticArrays.SVector{3, Float64} with indices SOneTo(3):
0.3289121239720345
0.11296169792358199
0.937580113647056
Expand Down
2 changes: 1 addition & 1 deletion src/sphere.jl
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ The point on the sphere is given as a unit vector `r`.
axis (i.e. 0° N, 180° W):
```jldoctest
julia> reckon([0.0, 0.0, 1.0], π/2, 0.0)
3-element StaticArrays.SArray{Tuple{3},Float64,1,3} with indices SOneTo(3):
3-element StaticArrays.SVector{3, Float64} with indices SOneTo(3):
-1.0
0.0
6.123233995736766e-17
Expand Down
19 changes: 11 additions & 8 deletions test/doctests.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
using Documenter, Logging

# Disable Documeter's Info logging
oldlvl = Logging.min_enabled_level(current_logger())
disable_logging(Logging.Info)
try
DocMeta.setdocmeta!(CMB, :DocTestSetup, :(using CMB); recursive=true)
doctest(CMB, testset="Doc Tests")
finally
disable_logging(oldlvl - 1)
# Outputs are Julia version specific
if VERSION >= v"1.6"
# Disable Documeter's Info logging
oldlvl = Logging.min_enabled_level(current_logger())
disable_logging(Logging.Info)
try
DocMeta.setdocmeta!(CMB, :DocTestSetup, :(using CMB); recursive=true)
doctest(CMB, testset="Doc Tests")
finally
disable_logging(oldlvl - 1)
end
end

0 comments on commit 236cac3

Please sign in to comment.