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

Progressmeter for output to file #223

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Conversation

MarcMush
Copy link
Collaborator

@MarcMush MarcMush commented Nov 9, 2021

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
Copy link
Collaborator Author

MarcMush commented Nov 9, 2021

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

@egajda
Copy link

egajda commented Mar 16, 2022

Is this still being considered as a feature?

@MarcMush
Copy link
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
Copy link
Owner

timholy commented Aug 4, 2023

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
Copy link
Collaborator Author

MarcMush commented Aug 4, 2023

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