add deprecation
This commit is contained in:
parent
e73f880a11
commit
41e3721018
17
src/args.jl
17
src/args.jl
@ -1612,6 +1612,10 @@ function warn_on_unsupported_args(pkg::AbstractBackend, plotattributes)
|
||||
already_warned = get!(_already_warned, bend, Set{Symbol}())
|
||||
extra_kwargs = Dict{Symbol,Any}()
|
||||
for k in keys(plotattributes)
|
||||
if k in keys(_deprecated_attributes)
|
||||
k in already_warned || push!(_to_warn, k)
|
||||
continue
|
||||
end
|
||||
is_attr_supported(pkg, k) && continue
|
||||
k in _suppress_warnings && continue
|
||||
default_value = default(k)
|
||||
@ -1626,9 +1630,16 @@ function warn_on_unsupported_args(pkg::AbstractBackend, plotattributes)
|
||||
get(plotattributes, :warn_on_unsupported, should_warn_on_unsupported(pkg))
|
||||
for k in sort(collect(_to_warn))
|
||||
push!(already_warned, k)
|
||||
@warn(
|
||||
"Keyword argument $k not supported with $pkg. Choose from: $(join(supported_attrs(pkg), ", "))"
|
||||
)
|
||||
if k in keys(_deprecated_attributes)
|
||||
@warn("""
|
||||
Keyword argument `$k` is deprecated.
|
||||
Please use `$(_deprecated_attributes[k])` instead.
|
||||
""")
|
||||
else
|
||||
@warn(
|
||||
"Keyword argument $k not supported with $pkg. Choose from: $(join(supported_attrs(pkg), ", "))"
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
return extra_kwargs
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
|
||||
const _deprecated_attributes = Dict{Symbol, Symbol}(:orientation => :series_permutation)
|
||||
const _all_defaults = KW[_series_defaults, _plot_defaults, _subplot_defaults]
|
||||
|
||||
const _initial_defaults = deepcopy(_all_defaults)
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using Plots, Test, NaNMath
|
||||
using Plots, Test
|
||||
|
||||
@testset "Series Attributes" begin
|
||||
pl = plot([[1, 2, 3], [2, 3, 4]], lw = 5)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user