Skip to content

Commit

Permalink
Drop compat code for partialsort from #401
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholters committed Oct 1, 2019
1 parent a5af839 commit 110fb2d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 18 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,6 @@ Currently, the `@compat` macro supports the following syntaxes:

* `Range` is now `AbstractRange` ([#23570])

* `select`* functions (`select`, `select!`, `selectperm`, `selectperm!`) are renamed to
`partialsort`* (`partialsort`, `partialsort!`, `partialsortperm`, `partialsortperm!`) ([#23051])

* `IntSet` is now `BitSet` ([#24282])

* `strwidth` and `charwidth` are now merged into `textwidth` ([#23667]).
Expand Down
9 changes: 0 additions & 9 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,6 @@ import Base.MathConstants

include("compatmacro.jl")

# 0.7.0-DEV.1535
@static if !isdefined(Base, :partialsort)
const partialsort = select
const partialsort! = select!
const partialsortperm = selectperm
const partialsortperm! = selectperm!
export partialsort, partialsort!, partialsortperm, partialsortperm!
end

# 0.7.0-DEV.1660
@static if !isdefined(Base, :pairs)
pairs(collection) = Base.Generator(=>, keys(collection), values(collection))
Expand Down
6 changes: 6 additions & 0 deletions test/old.jl
Original file line number Diff line number Diff line change
Expand Up @@ -246,3 +246,9 @@ let M = [1 + 2im 3 + 4im; 5 + 6im 7 + 8im],
adjoint!(M2, M)
@test M2 == Mc
end

# 0.7
@test partialsort([3,6,30,1,9], 2, rev=true) == 9
@test partialsort([3,6,30,1,9], 2, by=x->1/x) == 9
@test partialsortperm([3,6,30,1,9], 2, rev=true) == 5
@test partialsortperm([3,6,30,1,9], 2, by=x->1/x) == 5
6 changes: 0 additions & 6 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,6 @@ end
# 0.7
@test isa(1:2, AbstractRange)

# 0.7
@test partialsort([3,6,30,1,9], 2, rev=true) == 9
@test partialsort([3,6,30,1,9], 2, by=x->1/x) == 9
@test partialsortperm([3,6,30,1,9], 2, rev=true) == 5
@test partialsortperm([3,6,30,1,9], 2, by=x->1/x) == 5

# 0.7
@test isa(Base.rtoldefault(1.0, 2.0, 0), Float64)
@test isa(Base.rtoldefault(Float64, 2.0, 0), Float64)
Expand Down

0 comments on commit 110fb2d

Please sign in to comment.