Skip to content

Commit bb04eb8

Browse files
authored
Revert "Get IntervalArithmetic.jl ready for Julia 1.0 (#194)" (#202)
This reverts commit 33ab553.
1 parent 33ab553 commit bb04eb8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+841
-749
lines changed

.travis.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,17 @@ os:
1010
- osx
1111

1212
julia:
13-
- 0.7
14-
- 1.0
13+
- 0.6
1514
- nightly
1615

17-
#matrix:
18-
# allow_failures:
19-
# - julia: nightly
16+
matrix:
17+
allow_failures:
18+
- julia: nightly
2019

2120
notifications:
2221
email: false
2322

2423
after_success:
25-
- julia -e 'using Pkg; Pkg.add("Documenter")'
24+
- julia -e 'Pkg.add("Documenter")'
2625
- julia -e 'cd(Pkg.dir("IntervalArithmetic")); include(joinpath("docs", "make.jl"))'
2726
- julia -e 'cd(Pkg.dir("IntervalArithmetic")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder()); Codecov.submit(process_folder())'

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ setdisplay(:full)
146146
- `bisect` function in `ValidatedNumerics.RootFinding` for bisecting `Interval`s and `IntervalBox`es #217
147147

148148
### Other
149-
- Many tests use `Test` instead of `FactCheck` #205
149+
- Many tests use `Base.Test` instead of `FactCheck` #205
150150
- Miscellaneous bugfixes
151151

152152
## v0.6

REQUIRE

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
julia 0.7
2-
CRlibm 0.7
3-
StaticArrays 0.8
4-
FastRounding 0.1.2
5-
SetRounding 0.2
6-
RecipesBase 0.5
1+
julia 0.6
2+
CRlibm 0.6
3+
StaticArrays 0.5
4+
FastRounding 0.0.4
5+
AdjacentFloats 0.0.5
6+
RecipesBase
7+
Compat 0.69.0

appveyor.yml

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
environment:
22
matrix:
3-
- julia_version: 0.7
4-
- julia_version: 1
5-
- julia_version: nightly
6-
7-
platform:
8-
- x86 # 32-bit
9-
- x64 # 64-bit
10-
11-
# # Uncomment the following lines to allow failures on nightly julia
12-
# # (tests will run but not make your overall status red)
13-
# matrix:
14-
# allow_failures:
15-
# - julia_version: nightly
3+
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.6/julia-0.6-latest-win32.exe"
4+
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe"
5+
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
6+
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"
7+
8+
# uncomment the following lines to allow failures on nightly julia
9+
# (tests will run but not make your overall status red)
10+
matrix:
11+
allow_failures:
12+
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
13+
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"
1614

1715
branches:
1816
only:
1917
- master
20-
- /release-.*/
2118

2219
notifications:
2320
- provider: Email
@@ -26,18 +23,24 @@ notifications:
2623
on_build_status_changed: false
2724

2825
install:
29-
- ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1"))
26+
- ps: "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12"
27+
# If there's a newer build queued for the same PR, cancel this one
28+
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
29+
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
30+
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
31+
throw "There are newer queued builds for this pull request, failing early." }
32+
# Download most recent Julia Windows binary
33+
- ps: (new-object net.webclient).DownloadFile(
34+
$env:JULIA_URL,
35+
"C:\projects\julia-binary.exe")
36+
# Run installer silently, output to C:\projects\julia
37+
- C:\projects\julia-binary.exe /S /D=C:\projects\julia
3038

3139
build_script:
32-
- echo "%JL_BUILD_SCRIPT%"
33-
- C:\julia\bin\julia -e "%JL_BUILD_SCRIPT%"
40+
# Need to convert from shallow to complete for Pkg.clone to work
41+
- IF EXIST .git\shallow (git fetch --unshallow)
42+
- C:\projects\julia\bin\julia -e "versioninfo();
43+
Pkg.clone(pwd(), \"IntervalArithmetic\"); Pkg.build(\"IntervalArithmetic\")"
3444

3545
test_script:
36-
- echo "%JL_TEST_SCRIPT%"
37-
- C:\julia\bin\julia -e "%JL_TEST_SCRIPT%"
38-
39-
# # Uncomment to support code coverage upload. Should only be enabled for packages
40-
# # which would have coverage gaps without running on Windows
41-
# on_success:
42-
# - echo "%JL_CODECOV_SCRIPT%"
43-
# - C:\julia\bin\julia -e "%JL_CODECOV_SCRIPT%"
46+
- C:\projects\julia\bin\julia -e "Pkg.test(\"IntervalArithmetic\")"

docs/src/usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ to an `Interval{BigFloat}`, and then use routines from the `MPFR` library
293293

294294
- `^`
295295
- `exp2`, `exp10`
296-
- `atan`, `atanh`
296+
- `atan2`, `atanh`
297297

298298
Note, in particular, that in order to obtain correct rounding for the power function (`^`),
299299
intervals are converted to and from `BigFloat`; this implies a significant slow-down in this case.

src/IntervalArithmetic.jl

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,20 @@ __precompile__(true)
55
module IntervalArithmetic
66

77
import CRlibm
8-
98
using StaticArrays
109
using FastRounding
11-
using SetRounding
12-
13-
using Markdown
14-
15-
using LinearAlgebra
16-
import LinearAlgebra: ×, dot
17-
export ×, dot
10+
using AdjacentFloats
11+
using Compat
12+
13+
if VERSION <= v"0.7.0-DEV.2004"
14+
import Base: ×, dot
15+
import Compat.Sys
16+
export
17+
else
18+
using Markdown
19+
import Base:
20+
import LinearAlgebra: ×, dot
21+
end
1822

1923

2024
import Base:
@@ -23,26 +27,24 @@ import Base:
2327
in, zero, one, eps, typemin, typemax, abs, abs2, real, min, max,
2428
sqrt, exp, log, sin, cos, tan, inv,
2529
exp2, exp10, log2, log10,
26-
asin, acos, atan,
30+
asin, acos, atan, atan2,
2731
sinh, cosh, tanh, asinh, acosh, atanh,
2832
union, intersect, isempty,
2933
convert, promote_rule, eltype, size,
3034
BigFloat, float, widen, big,
31-
, , , , eps,
35+
, , , eps,
3236
floor, ceil, trunc, sign, round,
3337
expm1, log1p,
3438
precision,
3539
isfinite, isnan, isinf, iszero,
36-
show,
40+
show, showall,
3741
isinteger, setdiff,
3842
parse, hash
3943

4044
import Base: # for IntervalBox
4145
broadcast, length,
4246
getindex, setindex,
43-
iterate, eltype
44-
45-
import .Broadcast: broadcasted
47+
start, next, done, eltype
4648

4749
export
4850
AbstractInterval, Interval,
@@ -65,13 +67,6 @@ export
6567
export
6668
setindex # re-export from StaticArrays for IntervalBox
6769

68-
69-
if VERSION < v"1.0-dev"
70-
import Base.showall
71-
end
72-
73-
export showall
74-
7570
import Base: rounding, setrounding, setprecision
7671

7772

src/bisect.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ end
2121
Bisect the `IntervalBox` `X` at position α ∈ [0,1] along its longest side.
2222
"""
2323
function bisect(X::IntervalBox, α=where_bisect)
24-
i = argmax(diam.(X)) # find longest side
24+
i = indmax(diam.(X)) # find longest side
2525

2626
return bisect(X, i, α)
2727
end

src/decorations/functions.jl

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

3-
Base.literal_pow(::typeof(^), x::DecoratedInterval{T}, ::Val{p}) where {T,p} = x^p
4-
5-
63
# zero, one
74
zero(a::DecoratedInterval{T}) where T<:Real = DecoratedInterval(zero(T))
85
zero(::Type{DecoratedInterval{T}}) where T<:Real = DecoratedInterval(zero(T))
@@ -258,7 +255,7 @@ following the IEEE-1788 Standard (see Sect. 11.7.1, pp 47).
258255
""" union
259256

260257

261-
## Functions on unrestricted domains; tan and atan are treated separately
258+
## Functions on unrestricted domains; tan and atan2 are treated separately
262259
unrestricted_functions =(
263260
:exp, :exp2, :exp10,
264261
:sin, :cos,
@@ -293,10 +290,10 @@ function decay(a::DECORATION)
293290
ill
294291
end
295292

296-
function atan(yy::DecoratedInterval{T}, xx::DecoratedInterval{T}) where T
293+
function atan2(yy::DecoratedInterval{T}, xx::DecoratedInterval{T}) where T
297294
x = interval_part(xx)
298295
y = interval_part(yy)
299-
r = atan(y, x)
296+
r = atan2(y, x)
300297
d = decoration(r)
301298
d = min(d, decoration(xx), decoration(yy))
302299
# Check cases when decoration is trv and decays (from com or dac)

src/display.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ end
109109
function round_string(x::BigFloat, digits::Int, r::RoundingMode)
110110

111111
lng = digits + Int32(8)
112-
buf = Array{UInt8}(undef, lng + 1)
112+
@compat buf = Array{UInt8}(undef, lng + 1)
113113

114114
lng = ccall((:mpfr_snprintf,:libmpfr), Int32,
115115
(Ptr{UInt8}, Culong, Ptr{UInt8}, Int32, Ref{BigFloat}...),
116116
buf, lng + 1, "%.$(digits)R*g", Base.MPFR.to_mpfr(r), x)
117117

118118
repr = unsafe_string(pointer(buf))
119119

120-
repr = replace(repr, "nan" => "NaN")
120+
@compat repr = replace(repr, "nan" => "NaN")
121121

122122
return repr
123123
end
@@ -144,8 +144,8 @@ function basic_representation(a::Interval, format=nothing)
144144
bb = round_string(a.hi, sigfigs, RoundUp)
145145

146146
output = "[$aa, $bb]"
147-
output = replace(output, "inf" => "")
148-
output = replace(output, "Inf" => "")
147+
@compat output = replace(output, "inf" => "")
148+
@compat output = replace(output, "Inf" => "")
149149

150150
elseif format == :full
151151
output = "Interval($(a.lo), $(a.hi))"

src/intervals/conversion.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ promote_rule(::Type{BigFloat}, ::Type{Interval{T}}) where T<:Real =
1313

1414

1515
# convert methods:
16-
convert(::Type{Interval{T}}, x::Bool) where {T} = convert(Interval{T}, Int(x))
1716
convert(::Type{Interval{T}}, x::Real) where {T} = atomic(Interval{T}, x)
1817
convert(::Type{Interval{T}}, x::T) where {T<:Real} = Interval{T}(x)
1918
convert(::Type{Interval{T}}, x::Interval{T}) where {T} = x

0 commit comments

Comments
 (0)