Skip to content

Commit e2a0380

Browse files
ararslantimholy
authored andcommitted
Apply compat updates for Julia 0.6 (#139)
Apply compat updates for Julia 0.6
1 parent 837ed28 commit e2a0380

File tree

9 files changed

+27
-27
lines changed

9 files changed

+27
-27
lines changed

REQUIRE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ julia 0.4
33
WoodburyMatrices 0.1.5
44
Ratios
55
AxisAlgorithms
6-
Compat 0.8.0
6+
Compat 0.19.0
77
DualNumbers

src/Interpolations-old.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,26 +36,26 @@ export
3636
gradient,
3737
gradient!
3838

39-
abstract Degree{N}
39+
@compat abstract type Degree{N} end
4040

41-
abstract GridRepresentation
41+
@compat abstract type GridRepresentation end
4242
immutable OnGrid <: GridRepresentation end
4343
immutable OnCell <: GridRepresentation end
4444

45-
abstract BoundaryCondition
45+
@compat abstract type BoundaryCondition end
4646
immutable None <: BoundaryCondition end
4747
immutable Flat <: BoundaryCondition end
4848
immutable Line <: BoundaryCondition end
49-
typealias Natural Line
49+
const Natural = Line
5050
immutable Free <: BoundaryCondition end
5151
immutable Periodic <: BoundaryCondition end
5252
immutable Reflect <: BoundaryCondition end
5353

54-
abstract InterpolationType{D<:Degree,BC<:BoundaryCondition,GR<:GridRepresentation}
54+
@compat abstract type InterpolationType{D<:Degree,BC<:BoundaryCondition,GR<:GridRepresentation} end
5555

5656
include("extrapolation.jl")
5757

58-
abstract AbstractInterpolation{T,N,IT<:InterpolationType,EB<:ExtrapolationBehavior} <: AbstractArray{T,N}
58+
@compat abstract type AbstractInterpolation{T,N,IT<:InterpolationType,EB<:ExtrapolationBehavior} <: AbstractArray{T,N} end
5959
type Interpolation{T,N,TCoefs,IT<:InterpolationType,EB<:ExtrapolationBehavior} <: AbstractInterpolation{T,N,IT,EB}
6060
coefs::Array{TCoefs,N}
6161
end
@@ -258,4 +258,4 @@ end
258258

259259
nindexes(N::Int) = N == 1 ? "1 index" : "$N indexes"
260260

261-
end # module
261+
end # module

src/Interpolations.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,18 @@ import Base: convert, size, getindex, gradient, promote_rule, ndims, eltype
4343
if isdefined(:scaling) import Base.scaling end
4444
if isdefined(:scale) import Base.scale end
4545

46-
abstract Flag
47-
abstract InterpolationType <: Flag
46+
@compat abstract type Flag end
47+
@compat abstract type InterpolationType <: Flag end
4848
immutable NoInterp <: InterpolationType end
49-
abstract GridType <: Flag
49+
@compat abstract type GridType <: Flag end
5050
immutable OnGrid <: GridType end
5151
immutable OnCell <: GridType end
5252

53-
typealias DimSpec{T} Union{T,Tuple{Vararg{Union{T,NoInterp}}},NoInterp}
53+
@compat const DimSpec{T} = Union{T,Tuple{Vararg{Union{T,NoInterp}}},NoInterp}
5454

55-
abstract AbstractInterpolation{T,N,IT<:DimSpec{InterpolationType},GT<:DimSpec{GridType}} <: AbstractArray{T,N}
56-
abstract AbstractInterpolationWrapper{T,N,ITPT,IT,GT} <: AbstractInterpolation{T,N,IT,GT}
57-
abstract AbstractExtrapolation{T,N,ITPT,IT,GT} <: AbstractInterpolationWrapper{T,N,ITPT,IT,GT}
55+
@compat abstract type AbstractInterpolation{T,N,IT<:DimSpec{InterpolationType},GT<:DimSpec{GridType}} <: AbstractArray{T,N} end
56+
@compat abstract type AbstractInterpolationWrapper{T,N,ITPT,IT,GT} <: AbstractInterpolation{T,N,IT,GT} end
57+
@compat abstract type AbstractExtrapolation{T,N,ITPT,IT,GT} <: AbstractInterpolationWrapper{T,N,ITPT,IT,GT} end
5858

5959
immutable Throw <: Flag end
6060
immutable Flat <: Flag end
@@ -66,7 +66,7 @@ immutable InPlace <: Flag end
6666
# InPlaceQ is exact for an underlying quadratic. This is nice for ground-truth testing
6767
# of in-place (unpadded) interpolation.
6868
immutable InPlaceQ <: Flag end
69-
typealias Natural Line
69+
const Natural = Line
7070

7171
@generated size{T, N}(itp::AbstractInterpolation{T,N}) = Expr(:tuple, [:(size(itp, $i)) for i in 1:N]...)
7272
size(exp::AbstractExtrapolation, d) = size(exp.itp, d)

src/b-splines/b-splines.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export
77
Quadratic,
88
Cubic
99

10-
abstract Degree{N} <: Flag
10+
@compat abstract type Degree{N} <: Flag end
1111

1212
immutable BSpline{D<:Degree} <: InterpolationType end
1313
BSpline{D<:Degree}(::D) = BSpline{D}()
@@ -84,4 +84,4 @@ include("quadratic.jl")
8484
include("cubic.jl")
8585
include("indexing.jl")
8686
include("prefiltering.jl")
87-
include("../filter1d.jl")
87+
include("../filter1d.jl")

src/b-splines/indexing.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ using DualNumbers
33

44
import Base.getindex
55

6-
Base.linearindexing{T<:AbstractInterpolation}(::Type{T}) = Base.LinearSlow()
6+
@compat Base.IndexStyle(::Type{<:AbstractInterpolation}) = IndexCartesian()
77

88
define_indices{IT}(::Type{IT}, N, pad) = Expr(:block, Expr[define_indices_d(iextract(IT, d), d, padextract(pad, d)) for d = 1:N]...)
99

src/extrapolation/extrapolation.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Extrapolation{T,ITPT,IT,GT,ET}(::Type{T}, N, itp::ITPT, ::Type{IT}, ::Type{GT},
88
# However, no tuples should be nested deeper than this; the first level is for different
99
# schemes in different dimensions, and the second level is for different schemes in
1010
# different directions.
11-
typealias ExtrapDimSpec Union{Flag,Tuple{Vararg{Union{Flag,NTuple{2,Flag}}}}}
11+
const ExtrapDimSpec = Union{Flag,Tuple{Vararg{Union{Flag,NTuple{2,Flag}}}}}
1212

1313
"""
1414
`extrapolate(itp, scheme)` adds extrapolation behavior to an interpolation object, according to the provided scheme.
@@ -77,4 +77,4 @@ lbound(etp::Extrapolation, d) = lbound(etp.itp, d)
7777
ubound(etp::Extrapolation, d) = ubound(etp.itp, d)
7878
size(etp::Extrapolation, d) = size(etp.itp, d)
7979

80-
include("filled.jl")
80+
include("filled.jl")

src/gridded/gridded.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Gridded{D<:Degree}(::D) = Gridded{D}()
55

66
griddedtype{D<:Degree}(::Type{Gridded{D}}) = D
77

8-
typealias GridIndex{T} Union{AbstractVector{T}, Tuple}
8+
@compat const GridIndex{T} = Union{AbstractVector{T}, Tuple}
99

1010
# Because Ranges check bounds on getindex, it's actually faster to convert the
1111
# knots to Vectors. It's also good to take a copy, so it doesn't get modified later.
@@ -65,4 +65,4 @@ ubound(itp::GriddedInterpolation, d) = itp.knots[d][end]
6565

6666
include("constant.jl")
6767
include("linear.jl")
68-
include("indexing.jl")
68+
include("indexing.jl")

src/scaling/scaling.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ end
9898
rescale_gradient(r::StepRange, g) = g / r.step
9999
rescale_gradient(r::UnitRange, g) = g
100100

101-
@static if isdefined(:FloatRange) & isa(FloatRange, DataType)
101+
@static if isdefined(Base, :FloatRange) && VERSION < v"0.6.0-dev.2376"
102102
rescale_gradient(r::LinSpace, g) = g * r.divisor / (r.stop - r.start)
103103
rescale_gradient(r::FloatRange, g) = g * r.divisor / r.step
104104
coordlookup(r::LinSpace, x) = (r.divisor * x + r.stop - r.len * r.start) / (r.stop - r.start)

test/b-splines/linear.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ g2(y) = cos(y/6)
1414
f(x,y) = g1(x)*g2(y)
1515
A2 = Float64[f(x,y) for x in 1:xmax, y in 1:ymax]
1616

17-
for (constructor, copier) in ((interpolate, _->_), (interpolate!, copy))
17+
for (constructor, copier) in ((interpolate, identity), (interpolate!, copy))
1818
itp1c = @inferred(constructor(copier(A1), BSpline(Linear()), OnCell()))
1919

2020
# Just interpolation
2121
for x in 1:.2:xmax
2222
@test (f(x),itp1c[x],atol=abs(0.1 * f(x)))
2323
end
2424

25-
# Rational element types
25+
# Rational element types
2626
A1R = Rational{Int}[fr(x) for x in 1:10]
2727
itp1r = @inferred(constructor(copier(A1R), BSpline(Linear()), OnGrid()))
2828
@test @inferred(size(itp1r)) == size(A1R)
@@ -39,4 +39,4 @@ for (constructor, copier) in ((interpolate, _->_), (interpolate!, copy))
3939
end
4040
end
4141

42-
end
42+
end

0 commit comments

Comments
 (0)