Skip to content

Commit

Permalink
Add CategoricalArrays compat for 0.10 (#1537)
Browse files Browse the repository at this point in the history
* Add CategoricalArrays compat for 0.10

* Add using DataAPI
  • Loading branch information
rikhuijzer authored Apr 30, 2021
1 parent 120e75d commit 36a7521
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
Compose = "a81c6b42-2e10-5240-aca2-a61377ecd94b"
Contour = "d38c429a-6771-53c6-b99e-75d170b6e991"
CoupledFields = "7ad07ef1-bdf2-5661-9d2b-286fd4296dac"
DataAPI = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Expand All @@ -31,11 +32,12 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[compat]
Cairo = "0.7, 0.8, 1.0"
CategoricalArrays = "0.8, 0.9"
CategoricalArrays = "0.8, 0.9, 0.10"
Colors = "0.9, 0.10, 0.11, 0.12"
Compose = "0.9"
Contour = "0.5"
CoupledFields = "0.1, 0.2"
DataAPI = "1.6"
DataFrames = "0.21, 0.22"
DataStructures = "0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18"
Distributions = "0.16, 0.17, 0.18, 0.19, 0.20, 0.21, 0.22, 0.23, 0.24"
Expand Down
1 change: 1 addition & 0 deletions src/Gadfly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module Gadfly

using Colors
using Compose
using DataAPI
using DataStructures
using JSON
using Showoff
Expand Down
2 changes: 1 addition & 1 deletion src/misc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,6 @@ function discretize_make_ia(values::CategoricalArray{T}, levels::Vector) where {
return IndirectArray(index, convert(Vector{T},levels))
end
function discretize_make_ia(values::CategoricalArray{T}, levels::CategoricalVector{T}) where T
_levels = map!(t -> ismissing(t) ? t : get(t), Vector{T}(undef, length(levels)), levels)
_levels = map!(t -> ismissing(t) ? t : DataAPI.unwrap(t), Vector{T}(undef, length(levels)), levels)
discretize_make_ia(values, _levels)
end

0 comments on commit 36a7521

Please sign in to comment.