Skip to content

Commit

Permalink
Remove support for Julia v0.4 (#244)
Browse files Browse the repository at this point in the history
* Change REQUIRE to Julia 0.5

* Update test files to remove Julia 0.4 references

* Remove @compat

* Update .travis.yml

* Allow failure on 0.6 until all pieces are in place for tests to pass
  • Loading branch information
dpsanders authored Mar 7, 2017
1 parent 4584313 commit c7a230a
Show file tree
Hide file tree
Showing 25 changed files with 38 additions and 123 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ os:
- linux

julia:
- 0.4
- 0.5
- 0.6
- nightly

matrix:
allow_failures:
- julia: 0.6
- julia: nightly

notifications:
Expand Down
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
julia 0.4
julia 0.5
CRlibm 0.5
Compat 0.7.11
FixedSizeArrays 0.1.2
Expand Down
8 changes: 1 addition & 7 deletions src/ValidatedNumerics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,8 @@ export
export RootFinding


if VERSION >= v"0.5.0-dev+1182"
import Base: rounding, setrounding, setprecision
else
import Compat:
rounding, setrounding, setprecision
import Base: rounding, setrounding, setprecision

export rounding, setrounding, setprecision # reexport
end


## Multidimensional
Expand Down
2 changes: 0 additions & 2 deletions src/display.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ end
function round_string(x::BigFloat, digits::Int, r::RoundingMode)

lng = digits + Int32(8)
# buf = Array(UInt8, lng + 1)
# @compat buf = Base.StringVector(lng + 1)
buf = Array{UInt8}(lng + 1)

lng = ccall((:mpfr_snprintf,:libmpfr), Int32,
Expand Down
4 changes: 2 additions & 2 deletions src/intervals/intervals.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ eltype{T<:Real}(x::Interval{T}) = T
Interval(x::Interval) = x
Interval(x::Complex) = Interval(real(x)) + im*Interval(imag(x))

@compat (::Type{Interval{T}}){T}(x) = Interval(convert(T, x))
(::Type{Interval{T}}){T}(x) = Interval(convert(T, x))

@compat (::Type{Interval{T}}){T}(x::Interval) = convert(Interval{T}, x)
(::Type{Interval{T}}){T}(x::Interval) = convert(Interval{T}, x)

## Include files
include("special.jl")
Expand Down
8 changes: 4 additions & 4 deletions src/intervals/rounding_macros.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function round_expr(ex::Expr, rounding_mode::RoundingMode)
op = ex.args[1]

if op (:min, :max)
@compat mapped_args = round_expr.(ex.args[2:end], [rounding_mode]) # only in 0.5 and 0.6; in 0.6, can remove [...] around rounding_mode
mapped_args = round_expr.(ex.args[2:end], [rounding_mode]) # only in 0.5 and 0.6; in 0.6, can remove [...] around rounding_mode
return :($op($(mapped_args...)))
end

Expand Down Expand Up @@ -46,14 +46,14 @@ The macro uses the internal `round_expr` function to transform e.g.
The user-facing equivalent is `@interval`, which can handle much more general cases.
"""
@compat macro round(ex1, ex2)
macro round(ex1, ex2)
:(Interval($(round_expr(ex1, RoundDown)), $(round_expr(ex2, RoundUp))))
end

@compat macro round_down(ex1)
macro round_down(ex1)
round_expr(ex1, RoundDown)
end

@compat macro round_up(ex1)
macro round_up(ex1)
round_expr(ex1, RoundUp)
end
7 changes: 1 addition & 6 deletions test/decoration_tests/decoration_tests.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
if VERSION >= v"0.5.0-dev+7720"
using Base.Test
else
using BaseTestNext
const Test = BaseTestNext
end
using ValidatedNumerics
using Base.Test

@testset "DecoratedInterval tests" begin
a = DecoratedInterval(@interval(1, 2), com)
Expand Down
7 changes: 1 addition & 6 deletions test/display_tests/display.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
if VERSION >= v"0.5.0-dev+7720"
using Base.Test
else
using BaseTestNext
const Test = BaseTestNext
end
using ValidatedNumerics
using Base.Test

setprecision(Interval, Float64)

Expand Down
7 changes: 1 addition & 6 deletions test/interval_tests/complex.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
if VERSION >= v"0.5.0-dev+7720"
using Base.Test
else
using BaseTestNext
const Test = BaseTestNext
end
using ValidatedNumerics
using Base.Test

@testset "Complex interval operations" begin
a = @interval 1im
Expand Down
8 changes: 2 additions & 6 deletions test/interval_tests/consistency.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
# This file is part of the ValidatedNumerics.jl package; MIT licensed

if VERSION >= v"0.5.0-dev+7720"
using Base.Test
else
using BaseTestNext
const Test = BaseTestNext
end
using ValidatedNumerics
using Base.Test


setprecision(Interval, Float64)

Expand Down
8 changes: 2 additions & 6 deletions test/interval_tests/construction.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
# This file is part of the ValidatedNumerics.jl package; MIT licensed

if VERSION >= v"0.5.0-dev+7720"
using Base.Test
else
using BaseTestNext
const Test = BaseTestNext
end
using ValidatedNumerics
using Base.Test


@testset "Constructing intervals" begin
setprecision(Interval, 53)
Expand Down
8 changes: 2 additions & 6 deletions test/interval_tests/hyperbolic.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
# This file is part of the ValidatedNumerics.jl package; MIT licensed

if VERSION >= v"0.5.0-dev+7720"
using Base.Test
else
using BaseTestNext
const Test = BaseTestNext
end
using ValidatedNumerics
using Base.Test


setprecision(Interval, 128)
setprecision(Interval, Float64)
Expand Down
8 changes: 2 additions & 6 deletions test/interval_tests/linear_algebra.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
if VERSION >= v"0.5.0-dev+7720"
using Base.Test
else
using BaseTestNext
const Test = BaseTestNext
end
using ValidatedNumerics
using Base.Test



A =
Expand Down
8 changes: 1 addition & 7 deletions test/interval_tests/loops.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
if VERSION >= v"0.5.0-dev+7720"
using Base.Test
else
using BaseTestNext
const Test = BaseTestNext
end
using ValidatedNumerics

using Base.Test


@testset "Interval loop tests" begin
Expand Down
7 changes: 1 addition & 6 deletions test/interval_tests/non_BigFloat.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
if VERSION >= v"0.5.0-dev+7720"
using Base.Test
else
using BaseTestNext
const Test = BaseTestNext
end
using ValidatedNumerics
using Base.Test

@testset "Tests with rational intervals" begin

Expand Down
7 changes: 1 addition & 6 deletions test/interval_tests/numeric.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
# This file is part of the ValidatedNumerics.jl package; MIT licensed

if VERSION >= v"0.5.0-dev+7720"
using Base.Test
else
using BaseTestNext
const Test = BaseTestNext
end
using ValidatedNumerics
using Base.Test

setprecision(Interval, Float64)
setrounding(Interval, :narrow)
Expand Down
1 change: 1 addition & 0 deletions test/interval_tests/parsing.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using ValidatedNumerics
using Base.Test

setdisplay(:standard, decorations=true, sigfigs=6)

Expand Down
2 changes: 1 addition & 1 deletion test/interval_tests/rounding_macros.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using ValidatedNumerics

using Base.Test


@test ValidatedNumerics.round_expr(:(a + b), RoundDown) == :($(Expr(:escape, :a)) + $(Expr(:escape, :b)) + $(RoundDown))
Expand Down
7 changes: 1 addition & 6 deletions test/interval_tests/set_operations.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
# This file is part of the ValidatedNumerics.jl package; MIT licensed

if VERSION >= v"0.5.0-dev+7720"
using Base.Test
else
using BaseTestNext
const Test = BaseTestNext
end
using ValidatedNumerics
using Base.Test

setprecision(Interval, Float64)

Expand Down
7 changes: 1 addition & 6 deletions test/interval_tests/trig.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
# This file is part of the ValidatedNumerics.jl package; MIT licensed

if VERSION >= v"0.5.0-dev+7720"
using Base.Test
else
using BaseTestNext
const Test = BaseTestNext
end
using ValidatedNumerics
using Base.Test

setprecision(Interval, 128)
setprecision(Interval, Float64)
Expand Down
8 changes: 2 additions & 6 deletions test/multidim_tests/multidim.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
if VERSION >= v"0.5.0-dev+7720"
using Base.Test
else
using BaseTestNext
const Test = BaseTestNext
end
using ValidatedNumerics
using Base.Test


@testset "Operations on boxes" begin
A = IntervalBox(1..2, 3..4)
Expand Down
8 changes: 2 additions & 6 deletions test/root_finding_tests/bisect.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
if VERSION >= v"0.5.0-dev+7720"
using Base.Test
else
using BaseTestNext
const Test = BaseTestNext
end
using ValidatedNumerics, ValidatedNumerics.RootFinding
using Base.Test


@testset "Bisection tests" begin
x = Interval(0, 1)
Expand Down
8 changes: 2 additions & 6 deletions test/root_finding_tests/dual_promotion.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
if VERSION >= v"0.5.0-dev+7720"
using Base.Test
else
using BaseTestNext
const Test = BaseTestNext
end
using ValidatedNumerics, ValidatedNumerics.RootFinding
using ForwardDiff
using Base.Test


const Dual = ForwardDiff.Dual

Expand Down
9 changes: 2 additions & 7 deletions test/root_finding_tests/findroots.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
if VERSION >= v"0.5.0-dev+7720"
using Base.Test
else
using BaseTestNext
const Test = BaseTestNext
end

using ValidatedNumerics, ValidatedNumerics.RootFinding
using ForwardDiff

using Base.Test

const D = RootFinding.derivative

Expand Down
9 changes: 2 additions & 7 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
if VERSION >= v"0.5.0-dev+7720"
using Base.Test
else
using BaseTestNext
const Test = BaseTestNext
end
using ValidatedNumerics

using ValidatedNumerics
using Base.Test

# Interval tests:

Expand Down

0 comments on commit c7a230a

Please sign in to comment.