Skip to content

Commit

Permalink
Fix pluralisation in progress message
Browse files Browse the repository at this point in the history
  • Loading branch information
penelopeysm committed Nov 29, 2024
1 parent bc760b0 commit 06696bd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/sample.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Default implementations of `sample`.
const PROGRESS = Ref(true)

_pluralise(n; singular="", plural="s") = n == 1 ? singular : plural

"""
setprogress!(progress::Bool; silent::Bool=false)
Expand Down Expand Up @@ -372,7 +374,7 @@ function mcmcsample(
N::Integer,
nchains::Integer;
progress=PROGRESS[],
progressname="Sampling ($(min(nchains, Threads.nthreads())) threads)",
progressname="Sampling ($(min(nchains, Threads.nthreads())) thread$(_pluralise(min(nchains, Threads.nthreads())))",
initial_params=nothing,
initial_state=nothing,
kwargs...,
Expand Down Expand Up @@ -489,7 +491,7 @@ function mcmcsample(
N::Integer,
nchains::Integer;
progress=PROGRESS[],
progressname="Sampling ($(Distributed.nworkers()) processes)",
progressname="Sampling ($(Distributed.nworkers()) process$(_pluralise(Distributed.nworkers(); plural="es")))",
initial_params=nothing,
initial_state=nothing,
kwargs...,
Expand Down

0 comments on commit 06696bd

Please sign in to comment.