-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upgrade legacy argument dispatch methods with cleaner keyword version
- Loading branch information
1 parent
9257562
commit 6466463
Showing
13 changed files
with
399 additions
and
345 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# This file includes two kinds of codes | ||
# - Codes for backward compatibility | ||
# - Glue codes that might nolonger be necessary in the future | ||
|
||
# patch for issue #110 | ||
if isdefined(Base, :ComposedFunction) # Julia >= 1.6.0-DEV.85 | ||
# https://github.com/JuliaLang/julia/pull/37517 | ||
_round(tform::ComposedFunction; kwargs...) = _round(tform.outer; kwargs...) ∘ _round(tform.inner; kwargs...) | ||
end | ||
|
||
@static if !isdefined(Base, :IdentityUnitRange) | ||
const IdentityUnitRange = Base.Slice | ||
else | ||
using Base: IdentityUnitRange | ||
end | ||
|
||
@static if VERSION < v"1.1" | ||
@inline isnothing(x) = x === nothing | ||
end | ||
|
||
# FIXME: upstream https://github.com/JuliaGraphics/ColorVectorSpace.jl/issues/75 | ||
@inline _nan(::Type{HSV{Float16}}) = HSV{Float16}(NaN16,NaN16,NaN16) | ||
@inline _nan(::Type{HSV{Float32}}) = HSV{Float32}(NaN32,NaN32,NaN32) | ||
@inline _nan(::Type{HSV{Float64}}) = HSV{Float64}(NaN,NaN,NaN) | ||
@inline _nan(::Type{T}) where {T} = nan(T) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# BEGIN 0.9 deprecations | ||
|
||
@deprecate warp(img::AbstractArray, tform::Transformation, method::MethodType, ) warp(img, tform; method=method) | ||
@deprecate warp(img::AbstractArray, tform::Transformation, fillvalue::FillType) warp(img, tform; fillvalue=fillvalue) | ||
@deprecate warp(img::AbstractArray, tform::Transformation, method::MethodType, fillvalue::FillType) warp(img, tform; method=method, fillvalue=fillvalue) | ||
@deprecate warp(img::AbstractArray, tform::Transformation, fillvalue::FillType, method::MethodType) warp(img, tform; method=method, fillvalue=fillvalue) | ||
@deprecate warp(img::AbstractArray, tform::Transformation, inds, method::MethodType, ) warp(img, tform, inds; method=method) | ||
@deprecate warp(img::AbstractArray, tform::Transformation, inds, fillvalue::FillType) warp(img, tform, inds; fillvalue=fillvalue) | ||
@deprecate warp(img::AbstractArray, tform::Transformation, inds, method::MethodType, fillvalue::FillType) warp(img, tform, inds; method=method, fillvalue=fillvalue) | ||
@deprecate warp(img::AbstractArray, tform::Transformation, inds, fillvalue::FillType, method::MethodType) warp(img, tform, inds; method=method, fillvalue=fillvalue) | ||
|
||
@deprecate imrotate(img::AbstractArray, θ::Real, method::MethodType ) imrotate(img, θ; method=method) | ||
@deprecate imrotate(img::AbstractArray, θ::Real, fillvalue::FillType) imrotate(img, θ; fillvalue=fillvalue) | ||
@deprecate imrotate(img::AbstractArray, θ::Real, method::MethodType, fillvalue::FillType) imrotate(img, θ; method=method, fillvalue=fillvalue) | ||
@deprecate imrotate(img::AbstractArray, θ::Real, fillvalue::FillType, method::MethodType) imrotate(img, θ; method=method, fillvalue=fillvalue) | ||
@deprecate imrotate(img::AbstractArray, θ::Real, inds, method::MethodType ) imrotate(img, θ, inds; method=method) | ||
@deprecate imrotate(img::AbstractArray, θ::Real, inds, fillvalue::FillType) imrotate(img, θ, inds; fillvalue=fillvalue) | ||
@deprecate imrotate(img::AbstractArray, θ::Real, inds, method::MethodType, fillvalue::FillType) imrotate(img, θ, inds; method=method, fillvalue=fillvalue) | ||
@deprecate imrotate(img::AbstractArray, θ::Real, inds, fillvalue::FillType, method::MethodType) imrotate(img, θ, inds; method=method, fillvalue=fillvalue) | ||
|
||
@deprecate WarpedView(img::AbstractArray, tform::Transformation, method::MethodType, ) WarpedView(img, tform; method=method) | ||
@deprecate WarpedView(img::AbstractArray, tform::Transformation, fillvalue::FillType) WarpedView(img, tform; fillvalue=fillvalue) | ||
@deprecate WarpedView(img::AbstractArray, tform::Transformation, method::MethodType, fillvalue::FillType) WarpedView(img, tform; method=method, fillvalue=fillvalue) | ||
@deprecate WarpedView(img::AbstractArray, tform::Transformation, fillvalue::FillType, method::MethodType) WarpedView(img, tform; method=method, fillvalue=fillvalue) | ||
@deprecate WarpedView(img::AbstractArray, tform::Transformation, inds, method::MethodType, ) WarpedView(img, tform, inds; method=method) | ||
@deprecate WarpedView(img::AbstractArray, tform::Transformation, inds, fillvalue::FillType) WarpedView(img, tform, inds; fillvalue=fillvalue) | ||
@deprecate WarpedView(img::AbstractArray, tform::Transformation, inds, method::MethodType, fillvalue::FillType) WarpedView(img, tform, inds; method=method, fillvalue=fillvalue) | ||
@deprecate WarpedView(img::AbstractArray, tform::Transformation, inds, fillvalue::FillType, method::MethodType) WarpedView(img, tform, inds; method=method, fillvalue=fillvalue) | ||
|
||
@deprecate warpedview(args...; kwargs...) WarpedView(args...; kwargs...) | ||
|
||
@deprecate invwarpedview(img::AbstractArray, tinv::Transformation, method::MethodType, ) invwarpedview(img, tinv; method=method) | ||
@deprecate invwarpedview(img::AbstractArray, tinv::Transformation, fillvalue::FillType) invwarpedview(img, tinv; fillvalue=fillvalue) | ||
@deprecate invwarpedview(img::AbstractArray, tinv::Transformation, method::MethodType, fillvalue::FillType) invwarpedview(img, tinv; method=method, fillvalue=fillvalue) | ||
@deprecate invwarpedview(img::AbstractArray, tinv::Transformation, fillvalue::FillType, method::MethodType) invwarpedview(img, tinv; method=method, fillvalue=fillvalue) | ||
@deprecate invwarpedview(img::AbstractArray, tinv::Transformation, inds, method::MethodType, ) invwarpedview(img, tinv, inds; method=method) | ||
@deprecate invwarpedview(img::AbstractArray, tinv::Transformation, inds, fillvalue::FillType) invwarpedview(img, tinv, inds; fillvalue=fillvalue) | ||
@deprecate invwarpedview(img::AbstractArray, tinv::Transformation, inds, method::MethodType, fillvalue::FillType) invwarpedview(img, tinv, inds; method=method, fillvalue=fillvalue) | ||
@deprecate invwarpedview(img::AbstractArray, tinv::Transformation, inds, fillvalue::FillType, method::MethodType) invwarpedview(img, tinv, inds; method=method, fillvalue=fillvalue) | ||
|
||
# END 0.9 deprecations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.