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

Progressmeter for output to file

Open MarcMush opened this issue 4 years ago • 5 comments

this is could be an alternative to #222 this is based on what is already done for the keep keyword

set keepall=true in next! or update! for it to take effect (only for Progress right now, but it can easily be adapted to ProgressTresh and ProgressUnknown)

julia> io = IOBuffer()
       p = Progress(5, output=io)
       for i in 1:5
       sleep(0.2)
       next!(p, keepall=true, showvalues=[(:i,i),(:x,sin(i))])
       end
       String(take!(io))

Progress:  40%|█████████████████                        |  ETA: 0:00:01
  i:  2
  x:  0.9092974268256817
Progress:  60%|█████████████████████████                |  ETA: 0:00:00
  i:  3
  x:  0.1411200080598672
Progress:  80%|█████████████████████████████████        |  ETA: 0:00:00
  i:  4
  x:  -0.7568024953079282
Progress: 100%|█████████████████████████████████████████| Time: 0:00:01
  i:  5
  x:  -0.9589242746631385

if there are still escape characters in the output for the color, you can wrap the io in IOContext(io, :color => false)

MarcMush avatar Nov 09 '21 14:11 MarcMush

another option could be to have an global option similar to IJULIABEHAVIOR[] and CLEAR_IJULIA[]

MarcMush avatar Nov 09 '21 14:11 MarcMush

Is this still being considered as a feature?

egajda avatar Mar 16 '22 20:03 egajda

this is a draft of an alternative to #222, it's probably not hard to finish (some copy-paste and testing). I might work on it when I have the time but if someone wants this feature faster, they can work on it

MarcMush avatar Mar 17 '22 13:03 MarcMush

Sorry no one has given this a review. This looks reasonable and I'd support merging it if someone added tests and docs. I prefer this implementation to #222.

timholy avatar Aug 04 '23 09:08 timholy

This is still in progress, I will continue working on it

MarcMush avatar Aug 04 '23 14:08 MarcMush