diff --git a/Project.toml b/Project.toml index df06155..021d767 100644 --- a/Project.toml +++ b/Project.toml @@ -6,7 +6,6 @@ version = "0.3.0" DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" -ResumableFunctions = "c5292f4c-5179-55e1-98c5-05642aab7184" StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" [compat] @@ -14,5 +13,4 @@ julia = "1.8" DataStructures = "0.18" Distributions = "0.25" Random = "1" -ResumableFunctions = "0.6" StatsBase = "0.32, 0.33, 0.34" diff --git a/src/SortedSamplingMulti.jl b/src/SortedSamplingMulti.jl index 76b6260..a0bb330 100644 --- a/src/SortedSamplingMulti.jl +++ b/src/SortedSamplingMulti.jl @@ -13,7 +13,7 @@ function sortedindices_sample(rng, iter, n::Int; replace = false, ordered = fals end end end - iter_type = Base.@default_eltype(iter) + iter_type = calculate_eltype(iter) reservoir = Vector{iter_type}(undef, n) indices = get_sorted_indices(rng, n, N, replace) first_idx = indices[1] diff --git a/src/StreamSampling.jl b/src/StreamSampling.jl index 710f7a5..68a0e89 100644 --- a/src/StreamSampling.jl +++ b/src/StreamSampling.jl @@ -3,7 +3,6 @@ module StreamSampling using DataStructures using Distributions using Random -using ResumableFunctions using StatsBase struct WRSample end diff --git a/src/UnweightedSamplingMulti.jl b/src/UnweightedSamplingMulti.jl index 65dfced..697a89f 100644 --- a/src/UnweightedSamplingMulti.jl +++ b/src/UnweightedSamplingMulti.jl @@ -232,8 +232,6 @@ function update_all!(s, iter, ordered) end function calculate_eltype(iter) - return Base.@default_eltype(iter) -end -function calculate_eltype(iter::ResumableFunctions.FiniteStateMachineIterator) - return eltype(iter) + T = eltype(iter) + return T === Any ? Base.@default_eltype(iter) : T end