Skip to content

Commit

Permalink
Deprecation warning on keywords mem of LBFGS operators
Browse files Browse the repository at this point in the history
  • Loading branch information
abelsiqueira committed Apr 9, 2020
1 parent 174c648 commit 9f26ca1
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "LinearOperators"
uuid = "5c8ed15e-5a4c-59e4-a42b-c7e8811fb125"
version = "1.0.1"
version = "1.1.0"

[deps]
FastClosures = "9aa1b823-49e4-5ca5-8b0f-3971ec8bab6a"
Expand Down
2 changes: 2 additions & 0 deletions src/LinearOperators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ include("TimedOperators.jl")
# Utilities
include("utilities.jl")

include("deprecated.jl")

end # module
8 changes: 8 additions & 0 deletions src/deprecated.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Deprecated use of positional argument mem
@deprecate LBFGSOperator(T :: DataType, n :: Int, mem :: Int; kwargs...) LBFGSOperator(T, n; mem=mem, kwargs...) false
@deprecate LBFGSOperator(n :: Int, mem :: Int; kwargs...) LBFGSOperator(n; mem=mem, kwargs...) false
@deprecate InverseLBFGSOperator(T :: DataType, n :: Int, mem :: Int; kwargs...) InverseLBFGSOperator(T, n; mem=mem, kwargs...) false
@deprecate InverseLBFGSOperator(n :: Int, mem :: Int; kwargs...) InverseLBFGSOperator(n; mem=mem, kwargs...) false
@deprecate LSR1Operator(T :: DataType, n :: Int, mem :: Int; kwargs...) LSR1Operator(T, n; mem=mem, kwargs...) false
@deprecate LSR1Operator(n :: Int, mem :: Int; kwargs...) LSR1Operator(n; mem=mem, kwargs...) false

1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ include("test_lbfgs.jl")
include("test_lsr1.jl")
include("test_kron.jl")
include("test_callable.jl")
include("test_deprecated.jl")
15 changes: 15 additions & 0 deletions test/test_deprecated.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
function test_deprecated()
@testset ExtendedTestSet "Deprecated methods" begin
n = 10
mem = 3
T = Float16
@test_deprecated LBFGSOperator(n, mem, scaling=false)
@test_deprecated InverseLBFGSOperator(n, mem, scaling=false)
@test_deprecated LBFGSOperator(T, n, mem, scaling=false)
@test_deprecated InverseLBFGSOperator(T, n, mem, scaling=false)
@test_deprecated LSR1Operator(n, mem, scaling=false)
@test_deprecated LSR1Operator(T, n, mem, scaling=false)
end
end

test_deprecated()

0 comments on commit 9f26ca1

Please sign in to comment.