Skip to content

Commit

Permalink
Import StaticArrays.SVector into docs to have type-only printing
Browse files Browse the repository at this point in the history
This avoids a doctest failures from mismatched owner modules depending
on the version of StaticArrays which is loaded. For StaticArrays < v1.5,
the fully-qualified type is `StaticArrays.SVector`, but starting with
v1.5 the type definition moved to `StaticArraysCore.SVector`.

By importing explicitly from StaticArrays into the environment, the
printing system skips the module component and therefore we don't see
any discrepancy in printing no matter which version of
Julia + StaticArrays is being used.
  • Loading branch information
jmert committed Jul 23, 2022
1 parent e0cf8f5 commit 5e3d92d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/src/man/healpix.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ julia> pix2ang(nside, 103) .|> rad2deg
The other common way to represent coordinates on the sphere is via unit vectors.
The corresponding vector for a given pixel is retrieved with
[`CMB.Healpix.pix2vec`](@ref).
```jldoctest healpix
```jldoctest healpix; setup = (import StaticArrays: SVector)
julia> pix2vec(nside, 103)
3-element StaticArrays.SVector{3, Float64} with indices SOneTo(3):
3-element SVector{3, Float64} with indices SOneTo(3):
0.9807852804032304
-0.19509032201612828
0.0
Expand Down

0 comments on commit 5e3d92d

Please sign in to comment.