Skip to content

Commit 13985cc

Browse files
authored
Removed all deprecated methods and tests (#266)
1 parent aa2099e commit 13985cc

File tree

12 files changed

+6
-158
lines changed

12 files changed

+6
-158
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "KernelFunctions"
22
uuid = "ec8451be-7e33-11e9-00cf-bbf324bd1392"
3-
version = "0.8.26"
3+
version = "0.9.0"
44

55
[deps]
66
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"

docs/src/userguide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ For example, a squared exponential kernel is created by
2828
```math
2929
k(x, x'; P) = \exp{\big(- (x - x')^\top P (x - x')\big)}
3030
```
31-
for a positive definite matrix $P = Q^\top Q$, is deprecated. Instead you can
31+
for a positive definite matrix $P = Q^\top Q$, was removed in 0.9. Instead you can
3232
use a squared exponential kernel together with a [`LinearTransform`](@ref) of
3333
the inputs:
3434
```julia

src/KernelFunctions.jl

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
11
module KernelFunctions
22

3-
if !isfile(joinpath(@__DIR__, "update_v0.8.0"))
4-
printstyled(
5-
stdout,
6-
"""
7-
WARNING: SqExponentialKernel changed convention in version 0.8.0.
8-
This kernel now divides the squared distance by 2 to align with standard practice.
9-
This warning will be removed in 0.9.0.
10-
""";
11-
color=Base.info_color(),
12-
)
13-
touch(joinpath(@__DIR__, "update_v0.8.0"))
14-
end
15-
163
export kernelmatrix, kernelmatrix!, kernelmatrix_diag, kernelmatrix_diag!
174
export transform
185
export duplicate, set! # Helpers
@@ -119,8 +106,6 @@ include("zygoterules.jl")
119106

120107
include("test_utils.jl")
121108

122-
include("deprecated.jl")
123-
124109
function __init__()
125110
@require Kronecker = "2c470bb0-bcc8-11e8-3dad-c9649493f05e" begin
126111
include(joinpath("matrix", "kernelkroneckermat.jl"))

src/basekernels/piecewisepolynomial.jl

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -40,28 +40,8 @@ struct PiecewisePolynomialKernel{D,C<:Tuple} <: SimpleKernel
4040
end
4141
end
4242

43-
# TODO: remove `maha` keyword argument in next breaking release
44-
function PiecewisePolynomialKernel(; v::Int=-1, degree::Int=0, maha=nothing, dim::Int=-1)
45-
if v != -1
46-
Base.depwarn(
47-
"keyword argument `v` is deprecated, use `degree` instead",
48-
:PiecewisePolynomialKernel,
49-
)
50-
degree = v
51-
end
52-
53-
if maha !== nothing
54-
Base.depwarn(
55-
"keyword argument `maha` is deprecated, use a `LinearTransform` instead",
56-
:PiecewisePolynomialKernel,
57-
)
58-
dim = size(maha, 1)
59-
return transform(
60-
PiecewisePolynomialKernel{degree}(dim), LinearTransform(cholesky(maha).U)
61-
)
62-
else
63-
return PiecewisePolynomialKernel{degree}(dim)
64-
end
43+
function PiecewisePolynomialKernel(; degree::Int=0, dim::Int=-1)
44+
return PiecewisePolynomialKernel{degree}(dim)
6545
end
6646

6747
piecewise_polynomial_coefficients(::Val{0}, ::Int) = (1,)

src/basekernels/polynomial.jl

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,7 @@ struct PolynomialKernel{Tc<:Real} <: SimpleKernel
5656
end
5757
end
5858

59-
function PolynomialKernel(; d::Real=-1, degree::Int=2, c::Real=0.0)
60-
if d != -1
61-
Base.depwarn(
62-
"keyword argument `d` is deprecated, use `degree` instead",
63-
:PiecewisePolynomialKernel,
64-
)
65-
isinteger(d) || error("polynomial degree has to be an integer")
66-
degree::Int = convert(Int, d)
67-
end
59+
function PolynomialKernel(; degree::Int=2, c::Real=0.0)
6860
return PolynomialKernel{typeof(c)}(degree, [c])
6961
end
7062

src/deprecated.jl

Lines changed: 0 additions & 33 deletions
This file was deleted.

test/basekernels/maha.jl

Lines changed: 0 additions & 29 deletions
This file was deleted.

test/basekernels/piecewisepolynomial.jl

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,10 @@
77

88
k = PiecewisePolynomialKernel(; degree=degree, dim=D)
99
k2 = PiecewisePolynomialKernel{degree}(D)
10-
k3 = @test_deprecated PiecewisePolynomialKernel{degree}(maha)
11-
k4 = @test_deprecated PiecewisePolynomialKernel(; degree=degree, maha=maha)
12-
k5 = @test_deprecated PiecewisePolynomialKernel(; v=degree, dim=D)
13-
k6 = @test_deprecated PiecewisePolynomialKernel(; v=degree, maha=maha)
1410

1511
@test k2(v1, v2) == k(v1, v2)
16-
@test k3(v1, v2) k(v1, v2)
17-
@test k4(v1, v2) k(v1, v2)
18-
@test k5(v1, v2) k(v1, v2)
19-
@test k6(v1, v2) k(v1, v2)
2012

21-
@test_throws ErrorException PiecewisePolynomialKernel{4}(maha)
13+
@test_throws MethodError PiecewisePolynomialKernel{4}(maha)
2214
@test_throws ErrorException PiecewisePolynomialKernel{4}(D)
2315
@test_throws ErrorException PiecewisePolynomialKernel{degree}(-1)
2416
@test_throws ErrorException PiecewisePolynomialKernel()

test/basekernels/polynomial.jl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,9 @@
3434
@test metric(PolynomialKernel(; degree=3)) == KernelFunctions.DotProduct()
3535
@test metric(PolynomialKernel(; degree=3, c=c)) == KernelFunctions.DotProduct()
3636

37-
# Deprecations.
38-
k = @test_deprecated PolynomialKernel(; d=1)
39-
@test k.degree == 1
40-
4137
# Errors.
42-
@test_throws ArgumentError PolynomialKernel(; d=0)
4338
@test_throws ArgumentError PolynomialKernel(; degree=0)
4439
@test_throws ArgumentError PolynomialKernel(; c=-0.5)
45-
@test_throws ErrorException PolynomialKernel(; d=2.5)
4640

4741
# Standardised tests.
4842
TestUtils.test_interface(k, Float64)

test/kernels/kerneltensorproduct.jl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@
2727
end
2828
end
2929

30-
# Deprecations
31-
@test TensorProduct === KernelTensorProduct
32-
@test TensorProduct(k1, k2) == k1 k2
33-
@test TensorProduct((k1, k2)) == k1 k2
34-
@test TensorProduct([k1, k2]) == k1 k2
35-
3630
# Standardised tests.
3731
TestUtils.test_interface(kernel1, ColVecs{Float64})
3832
TestUtils.test_interface(kernel1, RowVecs{Float64})

0 commit comments

Comments
 (0)