Skip to content

Commit 20009cc

Browse files
committed
add @propagate_inbounds
1 parent c5ab4c6 commit 20009cc

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

ext/InterpolationsExt.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,20 @@ end
4040

4141
Interpolations.extrapolate(A::KeyedInterpolation, et) = KeyedInterpolation(dimnames(A), extrapolate(A.interpolation, et))
4242

43-
(ki::KeyedInterpolation)(args::Vararg{Number}) = ki.interpolation(args...)
44-
(ki::KeyedInterpolation)(args::NTuple{<:Any, Number}) = ki.interpolation(args...)
45-
(ki::KeyedInterpolation)(args::SVector) = ki.interpolation(args...)
46-
(ki::KeyedInterpolation)(args::NamedTuple) = ki.interpolation(args[dimnames(ki)]...)
47-
(ki::KeyedInterpolation)(;args...) = ki(NamedTuple(args))
43+
Base.@propagate_inbounds (ki::KeyedInterpolation)(args::Vararg{Number}) = ki.interpolation(args...)
44+
Base.@propagate_inbounds (ki::KeyedInterpolation)(args::NTuple{<:Any, Number}) = ki.interpolation(args...)
45+
Base.@propagate_inbounds (ki::KeyedInterpolation)(args::SVector) = ki.interpolation(args...)
46+
Base.@propagate_inbounds (ki::KeyedInterpolation)(args::NamedTuple) = ki.interpolation(args[dimnames(ki)]...)
47+
Base.@propagate_inbounds (ki::KeyedInterpolation)(;args...) = ki(NamedTuple(args))
4848

49-
Interpolations.gradient(ki::KeyedInterpolation, args::Vararg{Number}) = Interpolations.gradient(ki.interpolation, args...)
50-
Interpolations.gradient(ki::KeyedInterpolation, args::NTuple{<:Any, Number}) = Interpolations.gradient(ki.interpolation, args...)
51-
Interpolations.gradient(ki::KeyedInterpolation, args::SVector) = Interpolations.gradient(ki.interpolation, args...)
52-
function Interpolations.gradient(ki::KeyedInterpolation, args::NamedTuple)
49+
Base.@propagate_inbounds Interpolations.gradient(ki::KeyedInterpolation, args::Vararg{Number}) = Interpolations.gradient(ki.interpolation, args...)
50+
Base.@propagate_inbounds Interpolations.gradient(ki::KeyedInterpolation, args::NTuple{<:Any, Number}) = Interpolations.gradient(ki.interpolation, args...)
51+
Base.@propagate_inbounds Interpolations.gradient(ki::KeyedInterpolation, args::SVector) = Interpolations.gradient(ki.interpolation, args...)
52+
Base.@propagate_inbounds function Interpolations.gradient(ki::KeyedInterpolation, args::NamedTuple)
5353
keys(args) == dimnames(ki) || throw(ArgumentError("KeyedInterpolation gradient requires keys $(dimnames(ki)) but got $(keys(args))"))
5454
Interpolations.gradient(ki.interpolation, args...)
5555
end
56-
Interpolations.gradient(ki::KeyedInterpolation; args...) = Interpolations.gradient(ki.interpolation, args[dimnames(ki)]...)
56+
Base.@propagate_inbounds Interpolations.gradient(ki::KeyedInterpolation; args...) = Interpolations.gradient(ki.interpolation, args[dimnames(ki)]...)
5757

5858
AxisKeys.axiskeys(ki::KeyedInterpolation) = Interpolations.getknots(ki.interpolation)
5959
AxisKeys.named_axiskeys(ki::KeyedInterpolation) = NamedTuple{dimnames(ki)}(axiskeys(ki))

0 commit comments

Comments
 (0)