Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tcollect(withprogress(itr)) is currently broken #10

Closed
MasonProtter opened this issue Jun 29, 2023 · 2 comments · Fixed by #34
Closed

tcollect(withprogress(itr)) is currently broken #10

MasonProtter opened this issue Jun 29, 2023 · 2 comments · Fixed by #34

Comments

@MasonProtter
Copy link
Member

Quoting from JuliaFolds/Transducers.jl#557

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

and caused by JuliaFolds/Transducers.jl#553

@sethaxen
Copy link

Hi @MasonProtter, has there been any work on fixing this? Or, is there some workaround I can use for now?

@MasonProtter
Copy link
Member Author

Hey @sethaxen I'm really sorry I haven't gotten to this. The way withprogress works is a bit janky and each time I try to understand it I don't get very far. I'm hoping I can look at it again soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants