Skip to content

Deprecate TensorProduct correctly #243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "KernelFunctions"
uuid = "ec8451be-7e33-11e9-00cf-bbf324bd1392"
version = "0.8.19"
version = "0.8.20"

[deps]
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
Expand Down
5 changes: 1 addition & 4 deletions src/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,4 @@
PiecewisePolynomialKernel{V}(size(A, 1)), LinearTransform(cholesky(A).U)
)

@deprecate TensorProduct(kernels) KernelTensorProduct(kernels)
@deprecate TensorProduct(kernel::Kernel, kernels::Kernel...) KernelTensorProduct(
kernel, kernels...
)
Base.@deprecate_binding TensorProduct KernelTensorProduct
7 changes: 4 additions & 3 deletions test/kernels/kerneltensorproduct.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@
end

# Deprecations
@test (@test_deprecated TensorProduct(k1, k2)) == k1 ⊗ k2
@test (@test_deprecated TensorProduct((k1, k2))) == k1 ⊗ k2
@test (@test_deprecated TensorProduct([k1, k2])) == k1 ⊗ k2
@test TensorProduct === KernelTensorProduct
@test TensorProduct(k1, k2) == k1 ⊗ k2
Copy link
Member Author

@devmotion devmotion Jan 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deprecated bindings can't be tested with @test_deprecated, @test_warn, or @test_logs it seems. But I think these tests should be sufficient since TensorProduct is only defined in src/deprecated.jl.

@test TensorProduct((k1, k2)) == k1 ⊗ k2
@test TensorProduct([k1, k2]) == k1 ⊗ k2

# Standardised tests.
TestUtils.test_interface(kernel1, ColVecs{Float64})
Expand Down