Merge pull request #3277 from jebej/no-early-stringify

don't stringify argument to `warn_on_recipe_aliases!` early
This commit is contained in:
Daniel Schwabeneder 2021-02-07 19:38:05 +01:00 committed by GitHub
commit 19bb7340f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,13 +5,24 @@
function RecipesPipeline.warn_on_recipe_aliases!( function RecipesPipeline.warn_on_recipe_aliases!(
plt::Plot, plt::Plot,
plotattributes::AKW, plotattributes::AKW,
recipe_type, recipe_type::Symbol,
signature_string args
) )
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
if recipe_type == :user
signature_string = RecipesPipeline.userrecipe_signature_string(args)
elseif recipe_type == :type
signature_string = RecipesPipeline.typerecipe_signature_string(args)
elseif recipe_type == :plot
signature_string = RecipesPipeline.plotrecipe_signature_string(args)
elseif recipe_type == :series
signature_string = RecipesPipeline.seriesrecipe_signature_string(args)
else
throw(ArgumentError("Invalid recipe type `$recipe_type`"))
end
@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`." @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)