Skip to content

Commit

Permalink
Merge pull request #40 from JuliaData/bkamins-patch-1
Browse files Browse the repository at this point in the history
Change default pooled ref type
  • Loading branch information
quinnj authored Oct 29, 2020
2 parents 77feda8 + 941f678 commit 0d3fdfd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/PooledArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ PooledArray(d::PooledArray) = copy(d)

function _label(xs::AbstractArray,
::Type{T}=eltype(xs),
::Type{I}=UInt8,
::Type{I}=DEFAULT_POOLED_REF_TYPE,
start = 1,
labels = Array{I}(undef, size(xs)),
invpool::Dict{T,I} = Dict{T, I}(),
Expand Down
6 changes: 4 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ using DataAPI: refarray, refvalue, refpool

@test PooledArray{Union{Int,Missing}}([1, 2]) isa PooledArray{Union{Int,Missing}}

@test eltype(PooledArray(rand(128)).refs) == UInt8
@test eltype(PooledArray(rand(300)).refs) == UInt16
@test eltype(PooledArray(rand(128)).refs) == UInt32
@test eltype(PooledArray(rand(300)).refs) == UInt32
@test eltype(PooledArray(rand(128), UInt8).refs) == UInt8
@test eltype(PooledArray(rand(300), UInt16).refs) == UInt16
@test PooledVector == PooledArray{T, R, 1} where {T, R}
@test PooledMatrix == PooledArray{T, R, 2} where {T, R}

Expand Down

0 comments on commit 0d3fdfd

Please sign in to comment.