Skip to content

Commit 7ae4a88

Browse files
committed
Merge remote-tracking branch 'origin/master' into nl/array
2 parents 889c3f1 + 11d43c1 commit 7ae4a88

File tree

13 files changed

+382
-166
lines changed

13 files changed

+382
-166
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
version:
15+
# FIXME! Switch from 1.6 to 'min' once we require a higher minimum
16+
# We can't switch yet as there is a method ambiguity for a depndency
17+
# in version 1.6.0.
1518
- '1.6'
19+
- 'lts'
1620
- '1' # automatically expands to the latest stable 1.x release of Julia
17-
- 'nightly'
21+
- 'pre'
1822
os:
1923
- ubuntu-latest
20-
- macOS-latest
21-
- windows-latest
2224
arch:
2325
- x64
2426
- x86

Project.toml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,21 @@ Unicode = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
1616
Arrow = "69666777-d1a9-59fb-9406-91d4454c9d45"
1717
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
1818
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
19+
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
1920
SentinelArrays = "91c51154-3ec4-41a3-a24f-3f23e20d615c"
2021
StructTypes = "856f2bd8-1eba-4b0a-8007-ebc267875bd4"
2122

2223
[extensions]
2324
CategoricalArraysArrowExt = "Arrow"
2425
CategoricalArraysJSONExt = "JSON"
2526
CategoricalArraysRecipesBaseExt = "RecipesBase"
27+
CategoricalArraysStatsBaseExt = "StatsBase"
2628
CategoricalArraysSentinelArraysExt = "SentinelArrays"
2729
CategoricalArraysStructTypesExt = "StructTypes"
2830

2931
[compat]
3032
Arrow = "2"
31-
Compat = "3.37, 4"
33+
Compat = "3.47, 4.10"
3234
DataAPI = "1.6"
3335
JSON = "0.15, 0.16, 0.17, 0.18, 0.19, 0.20, 0.21"
3436
JSON3 = "1.1.2"
@@ -37,6 +39,7 @@ RecipesBase = "1.1"
3739
Requires = "1"
3840
SentinelArrays = "1"
3941
Statistics = "1"
42+
StatsBase = "0.15, 0.16, 0.17, 0.18, 0.19, 0.20, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.30, 0.31, 0.32, 0.33, 0.34"
4043
StructTypes = "1"
4144
julia = "1.6"
4245

@@ -45,12 +48,13 @@ Arrow = "69666777-d1a9-59fb-9406-91d4454c9d45"
4548
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
4649
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
4750
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
48-
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
4951
PooledArrays = "2dfb63ee-cc39-5dd5-95bd-886bf059d720"
5052
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
53+
RecipesPipeline = "01d81517-befc-4cb6-b9ec-a95719d0359c"
5154
SentinelArrays = "91c51154-3ec4-41a3-a24f-3f23e20d615c"
55+
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
5256
StructTypes = "856f2bd8-1eba-4b0a-8007-ebc267875bd4"
5357
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
5458

5559
[targets]
56-
test = ["Arrow", "Dates", "JSON", "JSON3", "Plots", "PooledArrays", "RecipesBase", "SentinelArrays", "StructTypes", "Test"]
60+
test = ["Arrow", "Dates", "JSON", "JSON3", "PooledArrays", "RecipesBase", "RecipesPipeline", "SentinelArrays", "StatsBase", "StructTypes", "Test"]

ext/CategoricalArraysStatsBaseExt.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module CategoricalArraysStatsBaseExt
2+
3+
if isdefined(Base, :get_extension)
4+
import CategoricalArrays: _wquantile
5+
using StatsBase
6+
else
7+
import ..CategoricalArrays: _wquantile
8+
using ..StatsBase
9+
end
10+
11+
_wquantile(x::AbstractArray, w::AbstractWeights, p::AbstractVector) = quantile(x, w, p)
12+
13+
end

src/CategoricalArrays.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ module CategoricalArrays
1111
import DataAPI: unwrap
1212
export unwrap
1313

14+
using Compat
15+
@compat public default_formatter, numbered_formatter
16+
1417
using DataAPI
1518
using Missings
1619
using Printf
17-
import Compat
1820

1921
# JuliaLang/julia#36810
2022
if VERSION < v"1.5.2"
@@ -33,8 +35,6 @@ module CategoricalArrays
3335
include("extras.jl")
3436
include("recode.jl")
3537

36-
include("deprecated.jl")
37-
3838
if !isdefined(Base, :get_extension)
3939
using Requires: @require
4040
end
@@ -45,6 +45,7 @@ module CategoricalArrays
4545
@require JSON="682c06a0-de6a-54ab-a142-c8b1cf79cde6" include("../ext/CategoricalArraysJSONExt.jl")
4646
@require RecipesBase="3cdcf5f2-1ef4-517c-9805-6587b60abb01" include("../ext/CategoricalArraysRecipesBaseExt.jl")
4747
@require SentinelArrays="91c51154-3ec4-41a3-a24f-3f23e20d615c" include("../ext/CategoricalArraysSentinelArraysExt.jl")
48+
@require StatsBase="2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" include("../ext/CategoricalArraysStatsBaseExt.jl")
4849
@require StructTypes="856f2bd8-1eba-4b0a-8007-ebc267875bd4" include("../ext/CategoricalArraysStructTypesExt.jl")
4950
end
5051
end

src/array.jl

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -797,13 +797,7 @@ entries corresponding to omitted levels will be set to `missing`.
797797
Else, `newlevels` must include all levels which appear in the data.
798798
"""
799799
function levels!(A::CategoricalArray{T, N, R}, newlevels::AbstractVector;
800-
allowmissing::Bool=false,
801-
allow_missing::Union{Bool, Nothing}=nothing) where {T, N, R}
802-
if allow_missing !== nothing
803-
Base.depwarn("allow_missing argument is deprecated, use allowmissing instead",
804-
:levels!)
805-
allowmissing = allow_missing
806-
end
800+
allowmissing::Bool=false) where {T, N, R}
807801
(levels(A) == newlevels) && return A # nothing to do
808802

809803
# map each new level to its ref code

src/deprecated.jl

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

0 commit comments

Comments
 (0)