Skip to content

Commit 0897d41

Browse files
lbenetdpsanders
authored andcommitted
Correct doctests to build docs (#124)
* Correct doctests to build docs * Remove `doc` before triple quotes in docstrings
1 parent 01d1482 commit 0897d41

File tree

12 files changed

+31
-31
lines changed

12 files changed

+31
-31
lines changed

docs/src/multidim.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ julia> X = IntervalBox(1..1, 2..2)
3838
[1, 1] × [2, 2]
3939
4040
julia> f(X...)
41-
([3, 3],[-1, -1])
41+
([3, 3], [-1, -1])
4242
4343
julia> IntervalBox(f(X...))
4444
[3, 3] × [-1, -1]

docs/src/usage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ julia> @interval(pi)
263263
To check which mode is currently set, use
264264
```jldoctest usage
265265
julia> precision(Interval)
266-
(Float64,256)
266+
(Float64, 256)
267267
```
268268
The result is a tuple of the type (currently `Float64` or `BigFloat`) and the current `BigFloat` precision.
269269

@@ -337,7 +337,7 @@ By default, the directed rounding used corresponds to using the `RoundDown` and
337337

338338
```jldoctest usage
339339
julia> setrounding(Interval, :slow)
340-
340+
:slow
341341
```
342342

343343
An alternative rounding method is to perform calculations using the (standard) `RoundNearest` rounding mode, and then widen the result by one machine epsilon in each direction using `prevfloat` and `nextfloat`. This is achived by

src/display.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ end
77
const display_params = DisplayParameters(:standard, false, 6)
88

99

10-
doc"""
10+
"""
1111
setformat(;kw)
1212
1313
`setformat` changes how intervals are displayed using keyword arguments.
@@ -49,7 +49,7 @@ function setformat(format = display_params.format;
4949
display_params.sigfigs = sigfigs
5050
end
5151

52-
doc"""
52+
"""
5353
@format [style::Symbol] [decorations::Bool] [sigfigs::Integer]
5454
5555
The `@format` macro provides a simple interface to control the output format

src/intervals/arithmetic.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ end
311311
# mid, diam, radius
312312

313313
# Compare pg. 64 of the IEEE 1788-2015 standard:
314-
doc"""
314+
"""
315315
mid(a::Interval, α=0.5)
316316
317317
Find the midpoint (or, in general, an intermediate point) at a distance α along the interval `a`. The default is the true midpoint at α=0.5.
@@ -347,7 +347,7 @@ end
347347

348348
mid(a::Interval{Rational{T}}) where T = (1//2) * (a.lo + a.hi)
349349

350-
doc"""
350+
"""
351351
diam(a::Interval)
352352
353353
Return the diameter (length) of the `Interval` `a`.
@@ -358,7 +358,7 @@ function diam(a::Interval{T}) where T<:Real
358358
@round_up(a.hi - a.lo) # cf page 64 of IEEE1788
359359
end
360360

361-
doc"""
361+
"""
362362
radius(a::Interval)
363363
364364
Return the radius of the `Interval` `a`, such that

src/intervals/macros.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file is part of the IntervalArithmetic.jl package; MIT licensed
22

3-
doc"""The `@interval` macro is the main method to create an interval.
3+
"""The `@interval` macro is the main method to create an interval.
44
It converts each expression into a narrow interval that is guaranteed to contain the true value passed by the user in the one or two expressions passed to it.
55
When passed two expressions, it takes the hull of the resulting intervals
66
to give a guaranteed containing interval.
@@ -20,19 +20,19 @@ macro interval(expr1, expr2...)
2020
make_interval(:(parameters.precision_type), expr1, expr2)
2121
end
2222

23-
doc"The `@floatinterval` macro constructs an interval with `Float64` entries."
23+
"The `@floatinterval` macro constructs an interval with `Float64` entries."
2424
macro floatinterval(expr1, expr2...)
2525
make_interval(Float64, expr1, expr2)
2626
end
2727

28-
doc"The `@biginterval` macro constructs an interval with `BigFloat` entries."
28+
"The `@biginterval` macro constructs an interval with `BigFloat` entries."
2929
macro biginterval(expr1, expr2...)
3030
make_interval(BigFloat, expr1, expr2)
3131
end
3232

3333

3434

35-
doc"""`transform` transforms a string by applying the function `f` and type
35+
"""`transform` transforms a string by applying the function `f` and type
3636
`T` to each argument, i.e. `:(x+y)` is transformed to `:(f(T, x) + f(T, y))`
3737
"""
3838
transform(x::Symbol, f, T) = :($f($T, $(esc(x)))) # use if x is not an expression
@@ -74,7 +74,7 @@ end
7474

7575

7676
# Called by interval and floatinterval macros
77-
doc"""`make_interval` does the hard work of taking expressions
77+
"""`make_interval` does the hard work of taking expressions
7878
and making each literal (0.1, 1, etc.) into a corresponding interval construction,
7979
by calling `transform`."""
8080

src/intervals/rounding.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ In Julia v0.6 and later (but *not* in Julia v0.5), this automatically redefines
2626
=#
2727

2828

29-
doc"""Interval rounding trait type"""
29+
"""Interval rounding trait type"""
3030
struct IntervalRounding{T} end
3131

3232
# Functions that are the same for all rounding types:
@@ -241,7 +241,7 @@ function _setrounding(::Type{Interval}, rounding_type::Symbol)
241241
current_rounding_type[] = rounding_type
242242
end
243243

244-
doc"""
244+
"""
245245
setrounding(Interval, rounding_type::Symbol)
246246
247247
Set the rounding type used for all interval calculations on Julia v0.6 and above.

src/intervals/set_operations.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Returns the "interval hull" of the intervals `a` and `b`, considered as
6969
all of `a` and `b`.
7070
"""
7171
hull(a::Interval, b::Interval) = Interval(min(a.lo, b.lo), max(a.hi, b.hi))
72-
#
72+
#
7373
# hull{T,S}(a::Interval{T}, b::Interval{S}) = hull(promote(a, b)...)
7474

7575
"""
@@ -84,7 +84,7 @@ union(a::Interval, b::Interval) = hull(a, b)
8484
# union(a::Interval, b::Interval) = union(promote(a, b)...)
8585

8686

87-
doc"""
87+
"""
8888
setdiff(x::Interval, y::Interval)
8989
9090
Calculate the set difference `x \ y`, i.e. the set of values

src/intervals/special.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Definitions of special intervals and associated functions
44

55
## Empty interval:
6-
doc"""`emptyinterval`s are represented as the interval [∞, -∞]; note
6+
"""`emptyinterval`s are represented as the interval [∞, -∞]; note
77
that this interval is an exception to the fact that the lower bound is
88
larger than the upper one."""
99
emptyinterval(::Type{T}) where T<:Real = Interval{T}(Inf, -Inf)
@@ -16,7 +16,7 @@ isempty(x::Interval) = x.lo == Inf && x.hi == -Inf
1616
const= Inf
1717

1818
## Entire interval:
19-
doc"""`entireinterval`s represent the whole Real line: [-∞, ∞]."""
19+
"""`entireinterval`s represent the whole Real line: [-∞, ∞]."""
2020
entireinterval(::Type{T}) where T<:Real = Interval{T}(-Inf, Inf)
2121
entireinterval(x::Interval{T}) where T<:Real = entireinterval(T)
2222
entireinterval() = entireinterval(precision(Interval)[1])
@@ -26,7 +26,7 @@ isunbounded(x::Interval) = x.lo == -Inf || x.hi == Inf
2626

2727

2828
# NaI: not-an-interval
29-
doc"""`NaI` not-an-interval: [NaN, NaN]."""
29+
"""`NaI` not-an-interval: [NaN, NaN]."""
3030
nai(::Type{T}) where T<:Real = Interval{T}(convert(T, NaN), convert(T, NaN))
3131
nai(x::Interval{T}) where T<:Real = nai(T)
3232
nai() = nai(precision(Interval)[1])
@@ -36,7 +36,7 @@ isnai(x::Interval) = isnan(x.lo) || isnan(x.hi)
3636
isfinite(x::Interval) = isfinite(x.lo) && isfinite(x.hi)
3737
isnan(x::Interval) = isnai(x)
3838

39-
doc"""
39+
"""
4040
isthin(x)
4141
4242
Checks if `x` is the set consisting of a single exactly
@@ -46,7 +46,7 @@ the standard.
4646
"""
4747
isthin(x::Interval) = x.lo == x.hi
4848

49-
doc"""
49+
"""
5050
iscommon(x)
5151
5252
Checks if `x` is a **common interval**, i.e. a non-empty,
@@ -77,7 +77,7 @@ isatomic(x::Interval) = isempty(x) || (x.hi == x.lo) || (x.hi == nextfloat(x.lo)
7777

7878
Base.iszero(x::Interval) = iszero(x.lo) && iszero(x.hi)
7979

80-
# doc"""
80+
# """
8181
# widen(x)
8282
#
8383
# Widens the lowest and highest bounds of `x` to the previous

src/intervals/trigonometric.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ half_range_atan2(::Type{T}) where {T} = (temp = half_pi(T); Interval(-(temp.hi),
2222
pos_range_atan2(::Type{T}) where {T<:Real} = Interval(zero(T), pi_interval(T).hi)
2323

2424

25-
doc"""Finds the quadrant(s) corresponding to a given floating-point
25+
"""Finds the quadrant(s) corresponding to a given floating-point
2626
number. The quadrants are labelled as 0 for x ∈ [0, π/2], etc.
2727
For numbers very near a boundary of the quadrant, a tuple of two quadrants
2828
is returned. The minimum or maximum must then be chosen appropriately.

src/multidim/intervalbox.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This file is part of the IntervalArithmetic.jl package; MIT licensed
22

3-
doc"""An `IntervalBox` is an $N$-dimensional rectangular box, given
4-
by a Cartesian product of $N$ `Interval`s.
3+
"""An `IntervalBox` is an `N`-dimensional rectangular box, given
4+
by a Cartesian product of `N` `Interval`s.
55
"""
66
struct IntervalBox{N,T} <: StaticVector{N, Interval{T}}
77
data::NTuple{N,Interval{T}}

0 commit comments

Comments
 (0)