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

The @showprogress macro throws a deprecation warning related to the Progress function #279

Closed
sylvaticus opened this issue Oct 1, 2023 · 2 comments

Comments

@sylvaticus
Copy link

Hello, the @showprogress macro throws a deprecation warning relative to the Progress function.
I think the Progress function has been updated to use a keywords-based arguments, but the macro didn't followed with the new api:

$ julia --depwarn=yes
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.9.0 (2023-05-07)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(@v1.9) pkg> activate --temp
  Activating new project at `/tmp/jl_9E7yqx`

(jl_9E7yqx) pkg> add ProgressMeter
   Resolving package versions...
    Updating `/tmp/jl_9E7yqx/Project.toml`
  [92933f4c] + ProgressMeter v1.9.0
    Updating `/tmp/jl_9E7yqx/Manifest.toml`
  [92933f4c] + ProgressMeter v1.9.0
  [8ba89e20] + Distributed
  [de0858da] + Printf
  [9a3f8284] + Random
  [ea8e919c] + SHA v0.7.0
  [9e88b42a] + Serialization
  [6462fe0b] + Sockets
  [4ec0a83e] + Unicode

julia> using ProgressMeter

julia> @showprogress 1 "test..." for i in 1:10
       println(i)
       end
┌ Warning: `Progress(n::Integer, dt::Real, desc::AbstractString = "Progress: ", barlen = nothing, color::Symbol = :green, output::IO = stderr; offset::Integer = 0)` is deprecated, use `Progress(n; dt = dt, desc = desc, barlen = barlen, color = color, output = output, offset = offset)` instead.
│   caller = ip:0x0
└ @ Core :-1
1
2
3
4
5
6
7
8
9
10
@MarcMush
Copy link
Collaborator

MarcMush commented Oct 2, 2023

The macro now also needs keywords:

@showprogress dt=1 desc="test..." for i in 1:10
    println(i)
    sleep(1)
end

@sylvaticus
Copy link
Author

Ok, thank you.

@MarcMush MarcMush closed this as completed Oct 2, 2023
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

No branches or pull requests

2 participants