-
-
Notifications
You must be signed in to change notification settings - Fork 358
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
A get API #4783
base: master
Are you sure you want to change the base?
A get API #4783
Conversation
Benchmark resultJudge resultBenchmark Report for /home/runner/work/Plots.jl/Plots.jlJob Properties
ResultsA ratio greater than
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfoTarget
Baseline
Target resultBenchmark Report for /home/runner/work/Plots.jl/Plots.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Baseline resultBenchmark Report for /home/runner/work/Plots.jl/Plots.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Runtime information
|
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #4783 +/- ##
==========================================
+ Coverage 89.87% 89.97% +0.10%
==========================================
Files 40 40
Lines 8396 8791 +395
==========================================
+ Hits 7546 7910 +364
- Misses 850 881 +31
☔ View full report in Codecov by Sentry. |
Benchmark resultJudge resultBenchmark Report for /home/runner/work/Plots.jl/Plots.jlJob Properties
ResultsA ratio greater than
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfoTarget
Baseline
Target resultBenchmark Report for /home/runner/work/Plots.jl/Plots.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Baseline resultBenchmark Report for /home/runner/work/Plots.jl/Plots.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Runtime information
|
@@ -161,13 +163,22 @@ function process_recipe_body!(expr::Expr) | |||
e = e.args[1] | |||
end | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
# `$` will be the recommended way to retrieve values | ||
if e.head === :call && e.args[1] === :(<--) # binary use | ||
target, attribute = e.args[2], e.args[3] | ||
expr.args[i] = Expr(:(=), target, :(plotattributes[$RecipesBase.canonical_key($(attribute))])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
expr.args[i] = Expr(:(=), target, :(plotattributes[$RecipesBase.canonical_key($(attribute))])) | |
expr.args[i] = Expr( | |
:(=), | |
target, | |
:(plotattributes[$RecipesBase.canonical_key($(attribute))]), | |
) |
target, attribute = e.args[2], e.args[3] | ||
expr.args[i] = Expr(:(=), target, :(plotattributes[$RecipesBase.canonical_key($(attribute))])) | ||
elseif e.head === :$ # unary use | ||
expr.args[i] = :(plotattributes[$RecipesBase.canonical_key($(QuoteNode(only(e.args))))]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
expr.args[i] = :(plotattributes[$RecipesBase.canonical_key($(QuoteNode(only(e.args))))]) | |
expr.args[i] = :(plotattributes[$RecipesBase.canonical_key( | |
$(QuoteNode(only(e.args))), | |
)]) |
RecipesBase/src/RecipesBase.jl
Outdated
else | ||
# if the user has set this keyword, use theirs | ||
:($RecipesBase.is_explicit(plotattributes, $k) || (plotattributes[$k] = $v)) | ||
:($RecipesBase.is_explicit(plotattributes, $k) || (plotattributes[$RecipesBase.canonical_key($k)] = $v)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
:($RecipesBase.is_explicit(plotattributes, $k) || (plotattributes[$RecipesBase.canonical_key($k)] = $v)) | |
:( | |
$RecipesBase.is_explicit(plotattributes, $k) || | |
(plotattributes[$RecipesBase.canonical_key($k)] = $v) | |
) |
@@ -5,9 +5,13 @@ import RecipesBase as RB | |||
using StableRNGs | |||
using Test | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
const KW = Dict{Symbol,Any} | ||
|
||
RB.is_key_supported(k::Symbol) = true | ||
# Reset method table so tests can be rerun (could be more robust) | ||
recipe_methods = methods(RB.apply_recipe) | ||
length(recipe_methods) > 2 && Base.delete_method.(methods(RB.apply_recipe)[setdiff(1:end, [1,8])]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
length(recipe_methods) > 2 && Base.delete_method.(methods(RB.apply_recipe)[setdiff(1:end, [1,8])]) | |
length(recipe_methods) > 2 && | |
Base.delete_method.(methods(RB.apply_recipe)[setdiff(1:end, [1, 8])]) |
test/test_args.jl
Outdated
@test :legend in aliases(:legend_position) | ||
Plots.add_non_underscore_aliases!(Plots._typeAliases) | ||
Plots.add_axes_aliases(:ticks, :tick) | ||
@test getattr(matrixheatmap(reshape(1:12, 3, 4))[1][1], :foreground_color) == RGBA(colorant"red") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
@test getattr(matrixheatmap(reshape(1:12, 3, 4))[1][1], :foreground_color) == RGBA(colorant"red") | |
@test getattr(matrixheatmap(reshape(1:12, 3, 4))[1][1], :foreground_color) == | |
RGBA(colorant"red") |
Description
Since we don't want to expose the canonical form of an attribute as API, I think a single getter function is a sensible choice here.
Please review carefully as this is going to get public API and there a quite a few subtleties, that we need to define here. E.g. what should
getattr(yaxis, :xlims)
return?Open tasks:
<--
here for retrieving attributes with alias resolution )Attribution