Skip to content

Commit c1124c1

Browse files
committed
Update benchmark naming with the new API
This makes it backwards-incompatible but will be more consistent for the future.
1 parent ededaab commit c1124c1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

perf/benchmarks.jl

+8-8
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ function sumvalues_indices(itp)
2727
ntuple(d->collect(range(first(inds[d])+0.001, stop=last(inds[d])-0.001, length=n)), ndims(itp))
2828
end
2929

30-
strip_prefix(str) = replace(str, "Interpolations."=>"")
30+
strip_prefix(str::AbstractString) = replace(str, "Interpolations."=>"")
3131
benchstr(::Type{T}) where {T<:Interpolations.GridType} = strip_prefix(string(T))
3232

3333
benchstr(::Type{Constant}) = "Constant()"
3434
benchstr(::Type{Linear}) = "Linear()"
35-
benchstr(::Type{Quadratic{BC}}) where {BC<:Interpolations.Flag} =
36-
string("Quadratic(", strip_prefix(string(BC)), "())")
37-
benchstr(::Type{Cubic{BC}}) where {BC<:Interpolations.Flag} =
38-
string("Quadratic(", strip_prefix(string(BC)), "())")
35+
benchstr(::Type{Quadratic{BC}}, ::Type{GT}) where {BC<:Interpolations.BoundaryCondition,GT<:Interpolations.GridType} =
36+
string("Quadratic(", strip_prefix(string(BC)), "(", strip_prefix(string(GT)), "()))")
37+
benchstr(::Type{Cubic{BC}}, ::Type{GT}) where {BC<:Interpolations.BoundaryCondition,GT<:Interpolations.GridType} =
38+
string("Cubic(", strip_prefix(string(BC)), "(", strip_prefix(string(GT)), "()))")
3939

4040
groupstr(::Type{Constant}) = "constant"
4141
groupstr(::Type{Linear}) = "linear"
@@ -62,7 +62,7 @@ for A in (collect(Float64, 1:3),
6262
gstr = groupstr(Quadratic)
6363
for BC in (Flat,Line,Free,Periodic,Reflect,Natural), GT in (OnGrid, OnCell)
6464
Ac = copy(A)
65-
idstr = string(ndims(A), "d_", benchstr(Quadratic{BC}), '_', benchstr(GT))
65+
idstr = string(ndims(A), "d_", benchstr(Quadratic{BC}, GT))
6666
suite["bsplines"][gstr][string(idstr, "_construct")] =
6767
@benchmarkable interpolate($Ac, BSpline(Quadratic($BC($GT()))))
6868
itp = interpolate(copy(A), BSpline(Quadratic(BC(GT()))))
@@ -72,7 +72,7 @@ for A in (collect(Float64, 1:3),
7272
end
7373
for BC in (InPlace,InPlaceQ)
7474
Ac = copy(A)
75-
idstr = string(ndims(A), "d_", benchstr(Quadratic{BC}), '_', benchstr(OnCell))
75+
idstr = string(ndims(A), "d_", benchstr(Quadratic{BC}, OnCell))
7676
suite["bsplines"][gstr][string(idstr, "_construct")] =
7777
@benchmarkable interpolate!($Ac, BSpline(Quadratic($BC(OnCell()))))
7878
itp = interpolate!(copy(A), BSpline(Quadratic(BC(OnCell()))))
@@ -84,7 +84,7 @@ for A in (collect(Float64, 1:3),
8484
gstr = groupstr(Cubic)
8585
for BC in (Flat,Line,Free,Periodic), GT in (OnGrid, OnCell)
8686
Ac = copy(A)
87-
idstr = string(ndims(A), "d_", benchstr(Cubic{BC}), '_', benchstr(GT))
87+
idstr = string(ndims(A), "d_", benchstr(Cubic{BC}, GT))
8888
suite["bsplines"][gstr][string(idstr, "_construct")] =
8989
@benchmarkable interpolate($Ac, BSpline(Cubic($BC($GT()))))
9090
itp = interpolate(copy(A), BSpline(Cubic(BC(GT()))))

0 commit comments

Comments
 (0)