Skip to content

Commit

Permalink
Mark Compat.qr from #534 for deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholters committed Oct 8, 2019
1 parent b7320c0 commit c3ff0ad
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 50 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ Currently, the `@compat` macro supports the following syntaxes:

* `fetch` for `Task`s ([#25940]).

* `Compat.qr` takes `pivot` as a `Val` _instance_ ([#22475]).

* `Compat.rmul!` provides a subset of the functionality of `LinearAlgebra.rmul!` for
use with Julia 0.6 ([#25701], [#25812]).

Expand Down
15 changes: 1 addition & 14 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import Pkg
import InteractiveUtils
import LibGit2
import UUIDs
using LinearAlgebra: qr


include("compatmacro.jl")
Expand All @@ -76,20 +77,6 @@ end
end
end

if VERSION < v"0.7.0-DEV.2337"
# qr doesn't take the full keyword anymore since 0.7.0-DEV.5211; we still support it
# here to avoid unneccesary breakage
if VERSION < v"0.7.0-DEV.843"
qr(A::Union{Number,AbstractMatrix}, pivot::Union{Val{false},Val{true}}=Val(false); full=false) =
Base.qr(A, typeof(pivot), thin=!full)
else
qr(A::Union{Number,AbstractMatrix}, pivot::Union{Val{false},Val{true}}=Val(false); full=false) =
Base.qr(A, pivot, thin=!full)
end
else
using LinearAlgebra: qr
end

# rmul! (NOTE: Purposefully not exported)
if VERSION < v"0.7.0-DEV.3563" # scale! not deprecated
if VERSION >= v"0.7.0-DEV.3449" # LinearAlgebra in the stdlib
Expand Down
10 changes: 10 additions & 0 deletions test/old.jl
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,16 @@ module TestUUIDs
@test uuid4() isa UUID
end

# 0.7.0-DEV.843 / 0.7.0-DEV.2337
let A = [1 2; 1 2; 1 2]
f = Compat.qr(A, Val(false))
@test size(f.Q) == (3, 3)
@test f.Q * [f.R; [0 0]] A
f = Compat.qr(A, Val(true))
@test size(f.Q) == (3, 3)
@test f.Q * [f.R; [0 0]] A[:,f.p]
end


# tests of removed functionality (i.e. justs tests Base)

Expand Down
34 changes: 0 additions & 34 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,40 +87,6 @@ end
@test length(Compat.CartesianIndices((1:2,))) == 2
@test length(Compat.CartesianIndices((1:2, -1:1))) == 6

# 0.7.0-DEV.843 / 0.7.0-DEV.2337
let A = [1 2; 1 2; 1 2]
if VERSION < v"0.7.0-DEV.5211"
# the full keyword was only temporarily available in Base, so these methods don't
# work on 0.7 anymore, but we test them for the time being to avoid accidentally
# breaking anyone's code
f = Compat.qr(A, Val(false), full=false)
@test f == Compat.qr(A, Val(false))
@test length(f) == 2
@test size(f[1]) == (3, 2)
@test f[1] * f[2] A
f = Compat.qr(A, Val(false), full=true)
@test length(f) == 2
@test size(f[1]) == (3, 3)
@test f[1] * [f[2]; [0 0]] A
f = Compat.qr(A, Val(true), full=false)
@test f == Compat.qr(A, Val(true))
@test length(f) == 3
@test size(f[1]) == (3, 2)
@test f[1] * f[2] A[:,f[3]]
f = Compat.qr(A, Val(true), full=true)
@test length(f) == 3
@test size(f[1]) == (3, 3)
@test f[1] * [f[2]; [0 0]] A[:,f[3]]
else
f = Compat.qr(A, Val(false))
@test size(f.Q) == (3, 3)
@test f.Q * [f.R; [0 0]] A
f = Compat.qr(A, Val(true))
@test size(f.Q) == (3, 3)
@test f.Q * [f.R; [0 0]] A[:,f.p]
end
end

let A = [1 2; 3 4]
@test Compat.rmul!(A, 2) == [2 4; 6 8]
@test Compat.rmul!(A, Diagonal([1, 2])) == [2 8; 6 16]
Expand Down

0 comments on commit c3ff0ad

Please sign in to comment.