Transducers.jl icon indicating copy to clipboard operation
Transducers.jl copied to clipboard

tcollect on withprogress now fails on v0.4.76

Open sethaxen opened this issue 1 year ago • 2 comments

The following is a new failure on v0.4.76:

using Transducers

Transducers.tcollect(Map(identity), withprogress(1:5; interval=1e-3))

On v0.4.75:

5-element Vector{Int64}:
 1
 2
 3
 4
 5

On v0.4.76:

julia> Transducers.tcollect(Map(identity), withprogress(1:5; interval=1e-3))
ERROR: MethodError: no method matching iterate(::Transducers.ProgressLoggingFoldable{UnitRange{Int64}})

Closest candidates are:
  iterate(::Union{LinRange, StepRangeLen})
   @ Base range.jl:880
  iterate(::Union{LinRange, StepRangeLen}, ::Integer)
   @ Base range.jl:880
  iterate(::T) where T<:Union{Base.KeySet{<:Any, <:Dict}, Base.ValueIterator{<:Dict}}
   @ Base dict.jl:698
  ...

Stacktrace:
  [1] iterate(::Base.Iterators.PartitionIterator{Transducers.ProgressLoggingFoldable{UnitRange{Int64}}})
    @ Base.Iterators ./iterators.jl:1319
  [2] copyto!(dest::Vector{Vector{Int64}}, src::Base.Iterators.PartitionIterator{Transducers.ProgressLoggingFoldable{UnitRange{Int64}}})
    @ Base ./abstractarray.jl:946
  [3] _collect(cont::UnitRange{Int64}, itr::Base.Iterators.PartitionIterator{Transducers.ProgressLoggingFoldable{UnitRange{Int64}}}, #unused#::Base.HasEltype, isz::Base.HasLength)
    @ Base ./array.jl:713
  [4] collect(itr::Base.Iterators.PartitionIterator{Transducers.ProgressLoggingFoldable{UnitRange{Int64}}})
    @ Base ./array.jl:707
  [5] split_into_chunks(coll::Transducers.ProgressLoggingFoldable{UnitRange{Int64}}, sz::Int64)
    @ Transducers ~/.julia/packages/Transducers/IWhZW/src/reduce.jl:364
  [6] _tcopy(xf::Map{typeof(identity)}, ::Type{Vector}, reducible::Transducers.ProgressLoggingFoldable{UnitRange{Int64}}, ::Transducers.SizeStable, ::Base.HasShape{1}; basesize::Int64, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Transducers ~/.julia/packages/Transducers/IWhZW/src/reduce.jl:358
  [7] _tcopy(xf::Map{typeof(identity)}, ::Type{Vector}, reducible::Transducers.ProgressLoggingFoldable{UnitRange{Int64}}, ::Transducers.SizeStable, ::Base.HasShape{1})
    @ Transducers ~/.julia/packages/Transducers/IWhZW/src/reduce.jl:356
  [8] tcopy(xf::Map{typeof(identity)}, T::Type, reducible::Transducers.ProgressLoggingFoldable{UnitRange{Int64}}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Transducers ~/.julia/packages/Transducers/IWhZW/src/reduce.jl:354
  [9] tcopy(xf::Map{typeof(identity)}, T::Type, reducible::Transducers.ProgressLoggingFoldable{UnitRange{Int64}})
    @ Transducers ~/.julia/packages/Transducers/IWhZW/src/reduce.jl:354
 [10] tcollect(xf::Map{typeof(identity)}, reducible::Transducers.ProgressLoggingFoldable{UnitRange{Int64}}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Transducers ~/.julia/packages/Transducers/IWhZW/src/reduce.jl:434
 [11] tcollect(xf::Map{typeof(identity)}, reducible::Transducers.ProgressLoggingFoldable{UnitRange{Int64}})
    @ Transducers ~/.julia/packages/Transducers/IWhZW/src/reduce.jl:434
 [12] top-level scope
    @ REPL[14]:1

sethaxen avatar Jun 23 '23 15:06 sethaxen

Crap, this is caused by https://github.com/JuliaFolds/Transducers.jl/pull/553

I think I'll have to figure out a good way to set up this halve-ing proceedure instead of using Iterators.partition`.


Note that this branch is no longer maintained. All work is continuing at https://github.com/JuliaFolds2/Transducers.jl so issues should be filed there.

MasonProtter avatar Jun 23 '23 20:06 MasonProtter

Hi @MasonProtter , has there been any work toward fixing this in https://github.com/JuliaFolds2/Transducers.jl?

sethaxen avatar Aug 24 '23 19:08 sethaxen