Skip to content

Commit 0d63434

Browse files
authored
Merge pull request #35 from FugroRoames/fbot/deps
Fix deprecations
2 parents 81421c6 + aa79aea commit 0d63434

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/coordinatesystems.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ struct Polar{T}
1010
end
1111
Base.show(io::IO, x::Polar) = print(io, "Polar(r=$(x.r), θ=$(x.θ) rad)")
1212
Base.isapprox(p1::Polar, p2::Polar; kwargs...) = isapprox(p1.r, p2.r; kwargs...) && isapprox(p1.θ, p2.θ; kwargs...)
13-
Base.eltype{T}(::Polar{T}) = T
14-
Base.eltype{T}(::Type{Polar{T}}) = T
13+
Base.eltype(::Polar{T}) where {T} = T
14+
Base.eltype(::Type{Polar{T}}) where {T} = T
1515

1616
"`PolarFromCartesian()` - transformation from `AbstractVector` of length 2 to `Polar` type"
1717
struct PolarFromCartesian <: Transformation; end
@@ -74,8 +74,8 @@ struct Spherical{T}
7474
end
7575
Base.show(io::IO, x::Spherical) = print(io, "Spherical(r=$(x.r), θ=$(x.θ) rad, ϕ=$(x.ϕ) rad)")
7676
Base.isapprox(p1::Spherical, p2::Spherical; kwargs...) = isapprox(p1.r, p2.r; kwargs...) && isapprox(p1.θ, p2.θ; kwargs...) && isapprox(p1.ϕ, p2.ϕ; kwargs...)
77-
Base.eltype{T}(::Spherical{T}) = T
78-
Base.eltype{T}(::Type{Spherical{T}}) = T
77+
Base.eltype(::Spherical{T}) where {T} = T
78+
Base.eltype(::Type{Spherical{T}}) where {T} = T
7979

8080
"""
8181
Cylindrical(r, θ, z) - 3D cylindrical coordinates
@@ -87,8 +87,8 @@ struct Cylindrical{T}
8787
end
8888
Base.show(io::IO, x::Cylindrical) = print(io, "Cylindrical(r=$(x.r), θ=$(x.θ) rad, z=$(x.z))")
8989
Base.isapprox(p1::Cylindrical, p2::Cylindrical; kwargs...) = isapprox(p1.r, p2.r; kwargs...) && isapprox(p1.θ, p2.θ; kwargs...) && isapprox(p1.z, p2.z; kwargs...)
90-
Base.eltype{T}(::Cylindrical{T}) = T
91-
Base.eltype{T}(::Type{Cylindrical{T}}) = T
90+
Base.eltype(::Cylindrical{T}) where {T} = T
91+
Base.eltype(::Type{Cylindrical{T}}) where {T} = T
9292

9393
"`SphericalFromCartesian()` - transformation from 3D point to `Spherical` type"
9494
struct SphericalFromCartesian <: Transformation; end
@@ -135,7 +135,7 @@ transform_deriv_params(::SphericalFromCartesian, x::AbstractVector) = error("Sph
135135
function (::CartesianFromSpherical)(x::Spherical)
136136
SVector(x.r * cos(x.θ) * cos(x.ϕ), x.r * sin(x.θ) * cos(x.ϕ), x.r * sin(x.ϕ))
137137
end
138-
function transform_deriv{T}(::CartesianFromSpherical, x::Spherical{T})
138+
function transform_deriv(::CartesianFromSpherical, x::Spherical{T}) where T
139139
= sin(x.θ)
140140
= cos(x.θ)
141141
= sin(x.ϕ)

test/affine.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
# A transformation for testing the local affine mapping
3-
immutable SquareMe <: Transformation; end
3+
struct SquareMe <: Transformation; end
44
(::SquareMe)(x) = x.^2
55
CoordinateTransformations.transform_deriv(::SquareMe, x0) = diagm(2*x0)
66

0 commit comments

Comments
 (0)