Skip to content

Commit 07b955f

Browse files
authored
Remove deprecations (#419)
In preparation of 1.0. These have been in place for years, it's unlikely people rely on them ayway.
1 parent 5dfe71e commit 07b955f

File tree

9 files changed

+7
-62
lines changed

9 files changed

+7
-62
lines changed

src/CategoricalArrays.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ module CategoricalArrays
3333
include("extras.jl")
3434
include("recode.jl")
3535

36-
include("deprecated.jl")
37-
3836
if !isdefined(Base, :get_extension)
3937
using Requires: @require
4038
end

src/array.jl

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -790,13 +790,7 @@ entries corresponding to omitted levels will be set to `missing`.
790790
Else, `newlevels` must include all levels which appear in the data.
791791
"""
792792
function levels!(A::CategoricalArray{T, N, R}, newlevels::AbstractVector;
793-
allowmissing::Bool=false,
794-
allow_missing::Union{Bool, Nothing}=nothing) where {T, N, R}
795-
if allow_missing !== nothing
796-
Base.depwarn("allow_missing argument is deprecated, use allowmissing instead",
797-
:levels!)
798-
allowmissing = allow_missing
799-
end
793+
allowmissing::Bool=false) where {T, N, R}
800794
(levels(A) == newlevels) && return A # nothing to do
801795

802796
# map each new level to its ref code

src/deprecated.jl

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

src/extras.jl

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -114,19 +114,7 @@ julia> cut(-1:0.5:1, 3, labels=fmt)
114114
@inline function cut(x::AbstractArray, breaks::AbstractVector;
115115
extend::Union{Bool, Missing}=false,
116116
labels::Union{AbstractVector{<:SupportedTypes},Function}=default_formatter,
117-
allowmissing::Union{Bool, Nothing}=nothing,
118-
allow_missing::Union{Bool, Nothing}=nothing,
119117
allowempty::Bool=false)
120-
if allow_missing !== nothing
121-
Base.depwarn("allow_missing argument is deprecated, use extend=missing instead",
122-
:cut)
123-
extend = missing
124-
end
125-
if allowmissing !== nothing
126-
Base.depwarn("allowmissing argument is deprecated, use extend=missing instead",
127-
:cut)
128-
extend = missing
129-
end
130118
return _cut(x, breaks, extend, labels, allowempty)
131119
end
132120

test/05_convert.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ using CategoricalArrays: DefaultRefType, refcode, reftype, leveltype
5555
@test convert(Union{T, U}, v3)::T == v3
5656
end
5757

58-
@test unwrap(v1) === get(v1) === 1
59-
@test unwrap(v2) === get(v2) === 2
60-
@test unwrap(v3) === get(v3) === 3
58+
@test unwrap(v1) === 1
59+
@test unwrap(v2) === 2
60+
@test unwrap(v3) === 3
6161

6262
@test promote(1, v1) === (1, 1)
6363
@test promote(1.0, v1) === (1.0, 1.0)

test/11_array.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ using CategoricalArrays: DefaultRefType, leveltype
719719
@test levels(x) == ["c", "a", "b"]
720720

721721
ordered!(x, ordered)
722-
v = CategoricalValue(2, CategoricalPool(["xyz", "b"]))
722+
v = CategoricalValue(CategoricalPool(["xyz", "b"]), 2)
723723
x[1] = v
724724
@test x[1] === CategoricalValue(x.pool, 4)
725725
@test x[2] === CategoricalValue(x.pool, 1)

test/13_arraycommon.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ end
893893
@test sort(cv, rev=rev, by=byf1) sort(cv, rev=rev, by=byf1)
894894

895895
# Check that by function is not called on unused levels/missing
896-
byf2 = x -> (@assert get(x) != "b"; x)
896+
byf2 = x -> (@assert x != "b"; x)
897897
replace!(cv, missing=>"a", "b"=>"a")
898898
@test sort(cv, rev=rev, by=byf2) sort(cv, rev=rev, by=byf2)
899899
end

test/17_deprecated.jl

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

test/runtests.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ module TestCategoricalArrays
2727
"13_arraycommon.jl",
2828
"14_view.jl",
2929
"15_extras.jl",
30-
"16_recode.jl",
31-
"17_deprecated.jl"
30+
"16_recode.jl"
3231
]
3332

3433
@testset "$test" for test in tests

0 commit comments

Comments
 (0)