From 236cac3edb848cfde6ca481700abfedeaecef459 Mon Sep 17 00:00:00 2001 From: Justin Willmert Date: Sat, 11 Dec 2021 11:10:14 -0600 Subject: [PATCH] =?UTF-8?q?Update=20doctests=20to=20Julia=20=E2=89=A5=20v1?= =?UTF-8?q?.6=20with=20aliased=20type=20printing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/src/man/healpix.md | 2 +- docs/src/man/sphere.md | 4 ++-- src/sphere.jl | 2 +- test/doctests.jl | 19 +++++++++++-------- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/docs/src/man/healpix.md b/docs/src/man/healpix.md index 53b1b10..b650aea 100644 --- a/docs/src/man/healpix.md +++ b/docs/src/man/healpix.md @@ -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 diff --git a/docs/src/man/sphere.md b/docs/src/man/sphere.md index 34fe0aa..c9d785a 100644 --- a/docs/src/man/sphere.md +++ b/docs/src/man/sphere.md @@ -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 @@ -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 diff --git a/src/sphere.jl b/src/sphere.jl index 5293857..621589f 100644 --- a/src/sphere.jl +++ b/src/sphere.jl @@ -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 diff --git a/test/doctests.jl b/test/doctests.jl index 7751aa7..30d9f34 100644 --- a/test/doctests.jl +++ b/test/doctests.jl @@ -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