Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
YichengDWu committed Nov 24, 2023
1 parent 2ebb5e7 commit 97a1508
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Optimisers = "3bd65402-5787-11e9-1adc-39752487f4e2"
Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba"
OptimizationOptimisers = "42dfb2eb-d2b4-4451-abcd-913932933ac1"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
ProgressBars = "49802e3a-d2f1-5c88-81d8-b72133a6f568"
QuasiMonteCarlo = "8a4e6c94-4038-4cdc-81c3-7e6ffdb2a71b"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
Expand Down
6 changes: 3 additions & 3 deletions src/showprogress.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using MacroTools
using ProgressMeter
using ProgressBars
using Printf

macro showprogress(expr)
Expand All @@ -19,14 +19,14 @@ macro showprogress(expr)
end

iter_var = gensym(:iter)
progress_expr = :($iter_var = Sophon.ProgressMeter.ProgressBar(1:$maxiters))
progress_expr = :($iter_var = ProgressBars.ProgressBar(1:$maxiters))

if isnothing(callback)
callback_var = gensym(:callback)
callback_def = quote
function $callback_var(p, l)
update($iter_var)
set_description($iter_var, string(Sophon.Printf.@sprintf("%.6e", l)))
set_description($iter_var, string(Printf.@sprintf("%.6e", l)))
return false
end
end
Expand Down

0 comments on commit 97a1508

Please sign in to comment.