|
40 | 40 |
|
41 | 41 | Interpolations.extrapolate(A::KeyedInterpolation, et) = KeyedInterpolation(dimnames(A), extrapolate(A.interpolation, et)) |
42 | 42 |
|
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)) |
48 | 48 |
|
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) |
53 | 53 | keys(args) == dimnames(ki) || throw(ArgumentError("KeyedInterpolation gradient requires keys $(dimnames(ki)) but got $(keys(args))")) |
54 | 54 | Interpolations.gradient(ki.interpolation, args...) |
55 | 55 | 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)]...) |
57 | 57 |
|
58 | 58 | AxisKeys.axiskeys(ki::KeyedInterpolation) = Interpolations.getknots(ki.interpolation) |
59 | 59 | AxisKeys.named_axiskeys(ki::KeyedInterpolation) = NamedTuple{dimnames(ki)}(axiskeys(ki)) |
|
0 commit comments