Skip to content

Commit

Permalink
Convert blocks to jldoctest
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeingold committed Jan 2, 2025
1 parent 8726e44 commit 09dced6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/src/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ does not provide anything useful for the end-users. You most probably want to
directly load the submodule with the dataset you are interested in. For
example, for CODATA 2022 load `PhysicalConstants.CODATA2022`:

```julia
```jldoctest
julia> using PhysicalConstants.CODATA2022
julia> SpeedOfLightInVacuum
Expand All @@ -30,7 +30,7 @@ full list of available constants is given below.
`PhysicalConstant`s can be readily used in mathematical operations, using by
default their `Float64` value:

```julia
```jldoctest
julia> import PhysicalConstants.CODATA2022: c_0, ε_0, μ_0
julia> 2 * ε_0
Expand All @@ -43,7 +43,7 @@ julia> ε_0 - 1 / (μ_0 * c_0 ^ 2)
If you want to use a different precision for the value of the constant, use the
function `float(float_type, constant)`, for example:

```julia
```jldoctest

Check failure on line 46 in docs/src/usage.md

View workflow job for this annotation

GitHub Actions / Documentation

doctest failure in src/usage.md:46-58 ```jldoctest julia> float(Float32, ε_0) 8.854188f-12 F m^-1 julia> float(BigFloat, ε_0) 8.854187818800000000000000000000000000000000000000000000000000000000000000000059e-12 F m^-1 julia> big(ε_0) 8.854187818800000000000000000000000000000000000000000000000000000000000000000059e-12 F m^-1 julia> big(ε_0) - inv(big(μ_0) * big(c_0)^2) 1.056704162590924117341831987227432956066714823419574007586677144869010778731235e-23 A^2 s^4 kg^-1 m^-3 ``` Subexpression: float(Float32, ε_0) Evaluated output: ERROR: UndefVarError: `ε_0` not defined in `Main` Suggestion: check for spelling errors or missing imports. Stacktrace: [1] top-level scope @ none:1 Expected output: 8.854188f-12 F m^-1 diff = Warning: Diff output requires color. 8.854188f-12 F m^-1ERROR: UndefVarError: `ε_0` not defined in `Main` Suggestion: check for spelling errors or missing imports. Stacktrace: [1] top-level scope @ none:1

Check failure on line 46 in docs/src/usage.md

View workflow job for this annotation

GitHub Actions / Documentation

doctest failure in src/usage.md:46-58 ```jldoctest julia> float(Float32, ε_0) 8.854188f-12 F m^-1 julia> float(BigFloat, ε_0) 8.854187818800000000000000000000000000000000000000000000000000000000000000000059e-12 F m^-1 julia> big(ε_0) 8.854187818800000000000000000000000000000000000000000000000000000000000000000059e-12 F m^-1 julia> big(ε_0) - inv(big(μ_0) * big(c_0)^2) 1.056704162590924117341831987227432956066714823419574007586677144869010778731235e-23 A^2 s^4 kg^-1 m^-3 ``` Subexpression: float(BigFloat, ε_0) Evaluated output: ERROR: UndefVarError: `ε_0` not defined in `Main` Suggestion: check for spelling errors or missing imports. Stacktrace: [1] top-level scope @ none:1 Expected output: 8.854187818800000000000000000000000000000000000000000000000000000000000000000059e-12 F m^-1 diff = Warning: Diff output requires color. 8.854187818800000000000000000000000000000000000000000000000000000000000000000059e-12 F m^-1ERROR: UndefVarError: `ε_0` not defined in `Main` Suggestion: check for spelling errors or missing imports. Stacktrace: [1] top-level scope @ none:1

Check failure on line 46 in docs/src/usage.md

View workflow job for this annotation

GitHub Actions / Documentation

doctest failure in src/usage.md:46-58 ```jldoctest julia> float(Float32, ε_0) 8.854188f-12 F m^-1 julia> float(BigFloat, ε_0) 8.854187818800000000000000000000000000000000000000000000000000000000000000000059e-12 F m^-1 julia> big(ε_0) 8.854187818800000000000000000000000000000000000000000000000000000000000000000059e-12 F m^-1 julia> big(ε_0) - inv(big(μ_0) * big(c_0)^2) 1.056704162590924117341831987227432956066714823419574007586677144869010778731235e-23 A^2 s^4 kg^-1 m^-3 ``` Subexpression: big(ε_0) Evaluated output: ERROR: UndefVarError: `ε_0` not defined in `Main` Suggestion: check for spelling errors or missing imports. Stacktrace: [1] top-level scope @ none:1 Expected output: 8.854187818800000000000000000000000000000000000000000000000000000000000000000059e-12 F m^-1 diff = Warning: Diff output requires color. 8.854187818800000000000000000000000000000000000000000000000000000000000000000059e-12 F m^-1ERROR: UndefVarError: `ε_0` not defined in `Main` Suggestion: check for spelling errors or missing imports. Stacktrace: [1] top-level scope @ none:1

Check failure on line 46 in docs/src/usage.md

View workflow job for this annotation

GitHub Actions / Documentation

doctest failure in src/usage.md:46-58 ```jldoctest julia> float(Float32, ε_0) 8.854188f-12 F m^-1 julia> float(BigFloat, ε_0) 8.854187818800000000000000000000000000000000000000000000000000000000000000000059e-12 F m^-1 julia> big(ε_0) 8.854187818800000000000000000000000000000000000000000000000000000000000000000059e-12 F m^-1 julia> big(ε_0) - inv(big(μ_0) * big(c_0)^2) 1.056704162590924117341831987227432956066714823419574007586677144869010778731235e-23 A^2 s^4 kg^-1 m^-3 ``` Subexpression: big(ε_0) - inv(big(μ_0) * big(c_0)^2) Evaluated output: ERROR: UndefVarError: `ε_0` not defined in `Main` Suggestion: check for spelling errors or missing imports. Stacktrace: [1] top-level scope @ none:1 Expected output: 1.056704162590924117341831987227432956066714823419574007586677144869010778731235e-23 A^2 s^4 kg^-1 m^-3 diff = Warning: Diff output requires color. 1.056704162590924117341831987227432956066714823419574007586677144869010778731235e-23 A^2 s^4 kg^-1 m^-3ERROR: UndefVarError: `ε_0` not defined in `Main` Suggestion: check for spelling errors or missing imports. Stacktrace: [1] top-level scope @ none:1
julia> float(Float32, ε_0)
8.854188f-12 F m^-1
Expand All @@ -62,7 +62,7 @@ Note that `big(constant)` is an alias for `float(BigFloat, constant)`.
If in addition to units you also want the standard uncertainty associated with
the constant, use `measurement(x)`:

```julia
```jldoctest
julia> using Measurements
julia> import PhysicalConstants.CODATA2022: h, ħ
Expand Down

0 comments on commit 09dced6

Please sign in to comment.