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

Structure docs more #247

Merged
merged 2 commits into from
Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ProgressMeter"
uuid = "92933f4c-e287-5a05-a399-4b506db050ca"
version = "1.7.2"
version = "1.7.3"

[deps]
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
Expand Down
35 changes: 21 additions & 14 deletions src/ProgressMeter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -483,11 +483,12 @@ end

# update progress display
"""
`next!(prog, [color], step = 1)` reports that `step` units of progress have been
made. Depending on the time interval since the last update, this may
or may not result in a change to the display.
next!(p::Union{Progress, ProgressUnknown}, [color]; step::Int = 1, options...)

You may optionally change the color of the display. See also `update!`.
Report that `step` units of progress have been made. Depending on the time interval since
the last update, this may or may not result in a change to the display.

You may optionally change the `color` of the display. See also `update!`.
"""
function next!(p::Union{Progress, ProgressUnknown}; step::Int = 1, options...)
lock_if_threading(p) do
Expand All @@ -505,13 +506,11 @@ function next!(p::Union{Progress, ProgressUnknown}, color::Symbol; step::Int = 1
end

"""
`update!(prog, counter, [color])` sets the progress counter to
`counter`, relative to the `n` units of progress specified when `prog`
was initialized. Depending on the time interval since the last
update, this may or may not result in a change to the display.
update!(p::Union{Progress, ProgressUnknown}, [counter,] [color]; options...)

If `prog` is a `ProgressThresh`, `update!(prog, val, [color])` specifies
the current value.
Set the progress counter to `counter`, relative to the `n` units of progress specified
when `prog` was initialized. Depending on the time interval since the last update,
this may or may not result in a change to the display.

You may optionally change the color of the display. See also `next!`.
"""
Expand All @@ -524,6 +523,11 @@ function update!(p::Union{Progress, ProgressUnknown}, counter::Int=p.counter, co
end
end

"""
update!(p::ProgressThresh, [val,] [color]; increment::Bool=true, options...)

Set the progress counter to current value `val`.
"""
function update!(p::ProgressThresh, val=p.val, color::Symbol=p.color; increment::Bool = true, options...)
lock_if_threading(p) do
p.val = val
Expand All @@ -537,9 +541,10 @@ end


"""
`cancel(prog, [msg], [color=:red])` cancels the progress display
before all tasks were completed. Optionally you can specify the
message printed and its color.
cancel(p::AbstractProgress, [msg,] [color=:red]; options...)

Cancel the progress display before all tasks were completed. Optionally you can specify
the message printed and its color.

See also `finish!`.
"""
Expand All @@ -562,7 +567,9 @@ function cancel(p::AbstractProgress, msg::AbstractString = "Aborted before all t
end

"""
`finish!(prog)` indicates that all tasks have been completed.
finish!(p::Progress; options...)

Indicate that all tasks have been completed.

See also `cancel`.
"""
Expand Down