When using interp1d with period given, the expected result is an interpolation assuming the signal is periodic. However in 0.3.2 it seems that this is not what is returned.
MWE:
from interpax import interp1d
import jax.numpy as jnp
xq = jnp.linspace(0,2*jnp.pi,endpoint=True)
x = jnp.linspace(0,2*jnp.pi,4,endpoint=False)
f = jnp.array([12,10,8,10])
fq= interp1d(xq, x, f, period=2*jnp.pi,method="cubic",derivative=0)
print(fq)
import matplotlib.pyplot as plt
plt.figure()
plt.plot(xq,fq)
plt.scatter(x,f)
import interpax
plt.title(f"interpax version {interpax.__version__}")
The change in 0.3.2 seems to be that the _make_periodic function no longer pads the x points to enforce periodicity (i.e. does not make the x and f arrays first and last points be the same). The above snippet works fine in 0.3.2 with linear as the interpolation method, but not with cubic or cubic2 (I have not tried the others)
When using
interp1d
with period given, the expected result is an interpolation assuming the signal is periodic. However in0.3.2
it seems that this is not what is returned.MWE:
The change in
0.3.2
seems to be that the_make_periodic
function no longer pads thex
points to enforce periodicity (i.e. does not make thex
andf
arrays first and last points be the same). The above snippet works fine in0.3.2
withlinear
as the interpolation method, but not withcubic
orcubic2
(I have not tried the others)