Skip to content

Progressmeter for output to file#223

Draft
MarcMush wants to merge 3 commits into
timholy:masterfrom
MarcMush:keepall
Draft

Progressmeter for output to file#223
MarcMush wants to merge 3 commits into
timholy:masterfrom
MarcMush:keepall

Conversation

@MarcMush

@MarcMush MarcMush commented Nov 9, 2021

Copy link
Copy Markdown
Collaborator

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

MarcMush commented Nov 9, 2021

Copy link
Copy Markdown
Collaborator Author

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

@egajda

egajda commented Mar 16, 2022

Copy link
Copy Markdown

Is this still being considered as a feature?

@MarcMush

Copy link
Copy Markdown
Collaborator Author

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

@timholy

timholy commented Aug 4, 2023

Copy link
Copy Markdown
Owner

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.

@MarcMush

MarcMush commented Aug 4, 2023

Copy link
Copy Markdown
Collaborator Author

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

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 this pull request may close these issues.

3 participants