JuliaMath / Interpolations.jl

Fast, continuous interpolation of discrete datasets in Julia
http://juliamath.github.io/Interpolations.jl/
Other
523 stars 110 forks source link

`scale` should accept parameter `xs` as a tuple #528

Closed jeffreyesun closed 1 year ago

jeffreyesun commented 1 year ago

Consider the following construction: scale(interpolate(ones(2,2), BSpline(Linear())), 1:2, 1:2) The printed description of this object is given as scale(interpolate(::Matrix{Float64}, BSpline(Linear())), (1:2, 1:2)) Note the xs (1:2,1:2) are printed as a tuple.

However, the following construction fails: scale(interpolate(ones(2,2), BSpline(Linear())), (1:2, 1:2)) #ERROR: MethodError: no method matching scale(...

I propose that we define this method so that one can write scale(interpolate(ones(2,2), BSpline(Linear())), (1:2, 1:2)) and get scale(interpolate(ones(2,2), BSpline(Linear())), 1:2, 1:2).

In fact, it took me quite a while to realize that the second construction was required, and figure out why my construction wasn't working.

mkitti commented 1 year ago

I concur. Will fix.