Skip to content

Commit dea3467

Browse files
authored
Merge pull request #36 from rdeits/v0.7-updates
Fix v0.7 deprecation warnings
2 parents 0d63434 + 09880f6 commit dea3467

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

REQUIRE

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
julia 0.6
22
StaticArrays
33
Rotations 0.3.0
4+
Compat 0.33

src/CoordinateTransformations.jl

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ __precompile__()
33
module CoordinateTransformations
44

55
using StaticArrays
6+
using Compat.LinearAlgebra
67

78
using Rotations
89
export RotMatrix, Quat, SpQuat, AngleAxis, RodriguesVec,

src/affine.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ end
1414
Translation(x::Tuple) = Translation(SVector(x))
1515
Translation(x,y) = Translation(SVector(x,y))
1616
Translation(x,y,z) = Translation(SVector(x,y,z))
17-
Base.show(io::IO, trans::Translation) = print(io, "Translation$((trans.v...))")
17+
Base.show(io::IO, trans::Translation) = print(io, "Translation$((trans.v...,))")
1818

1919
function (trans::Translation{V})(x) where {V}
2020
x + trans.v

test/affine.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# A transformation for testing the local affine mapping
33
struct SquareMe <: Transformation; end
44
(::SquareMe)(x) = x.^2
5-
CoordinateTransformations.transform_deriv(::SquareMe, x0) = diagm(2*x0)
5+
CoordinateTransformations.transform_deriv(::SquareMe, x0) = Matrix(Diagonal(2*x0))
66

77

88
@testset "Common Transformations" begin
@@ -80,12 +80,12 @@ CoordinateTransformations.transform_deriv(::SquareMe, x0) = diagm(2*x0)
8080
# Transform derivative
8181
m1 = transform_deriv(trans, x)
8282
m2 = [m1[i,j] for i=1:2, j=1:2] # m1 might be a UniformScaling
83-
@test m2 == eye(2)
83+
@test m2 == Matrix(I, 2, 2) # in v0.7 and above, this can just be `== I`
8484

8585
# Transform parameter derivative
8686
m1 = transform_deriv_params(trans, x)
8787
m2 = [m1[i,j] for i=1:2, j=1:2] # m1 might be a UniformScaling
88-
@test m2 == eye(2)
88+
@test m2 == Matrix(I, 2, 2) # In v0.7 and above, this can just be `== I`
8989
end
9090

9191
@testset "Recenter" begin

test/runtests.jl

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
using Compat.Test
2+
using Compat.LinearAlgebra
13
using CoordinateTransformations
2-
using Base.Test
34
using ForwardDiff: Dual, partials
45
using StaticArrays
56

0 commit comments

Comments
 (0)