move warn_on_recipe_aliases to RecipesPipeline
This commit is contained in:
parent
fe2bae37f3
commit
e21f40bd9a
@ -4,43 +4,20 @@
|
|||||||
|
|
||||||
function RecipesPipeline.warn_on_recipe_aliases!(
|
function RecipesPipeline.warn_on_recipe_aliases!(
|
||||||
plt::Plot,
|
plt::Plot,
|
||||||
plotattributes,
|
plotattributes::AKW,
|
||||||
recipe_type,
|
recipe_type,
|
||||||
args...,
|
signature_string
|
||||||
)
|
)
|
||||||
for k in keys(plotattributes)
|
for k in keys(plotattributes)
|
||||||
if !is_default_attribute(k)
|
if !is_default_attribute(k)
|
||||||
dk = get(_keyAliases, k, k)
|
dk = get(_keyAliases, k, k)
|
||||||
if k !== dk
|
if k !== dk
|
||||||
@warn "Attribute alias `$k` detected in the $recipe_type recipe defined for the signature $(_signature_string(Val{recipe_type}, args...)). To ensure expected behavior it is recommended to use the default attribute `$dk`."
|
@warn "Attribute alias `$k` detected in the $recipe_type recipe defined for the signature $signature_string. To ensure expected behavior it is recommended to use the default attribute `$dk`."
|
||||||
end
|
end
|
||||||
plotattributes[dk] = RecipesPipeline.pop_kw!(plotattributes, k)
|
plotattributes[dk] = RecipesPipeline.pop_kw!(plotattributes, k)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function RecipesPipeline.warn_on_recipe_aliases!(
|
|
||||||
plt::Plot,
|
|
||||||
v::AbstractVector,
|
|
||||||
recipe_type,
|
|
||||||
args...,
|
|
||||||
)
|
|
||||||
foreach(x -> RecipesPipeline.warn_on_recipe_aliases!(plt, x, recipe_type, args...), v)
|
|
||||||
end
|
|
||||||
function RecipesPipeline.warn_on_recipe_aliases!(
|
|
||||||
plt::Plot,
|
|
||||||
rd::RecipeData,
|
|
||||||
recipe_type,
|
|
||||||
args...,
|
|
||||||
)
|
|
||||||
RecipesPipeline.warn_on_recipe_aliases!(plt, rd.plotattributes, recipe_type, args...)
|
|
||||||
end
|
|
||||||
|
|
||||||
function _signature_string(::Type{Val{:user}}, args...)
|
|
||||||
return string("(::", join(string.(typeof.(args)), ", ::"), ")")
|
|
||||||
end
|
|
||||||
_signature_string(::Type{Val{:type}}, T) = "(::Type{$T}, ::$T)"
|
|
||||||
_signature_string(::Type{Val{:plot}}, st) = "(::Type{Val{:$st}}, ::AbstractPlot)"
|
|
||||||
_signature_string(::Type{Val{:series}}, st) = "(::Type{Val{:$st}}, x, y, z)"
|
|
||||||
|
|
||||||
|
|
||||||
## Grouping
|
## Grouping
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user