Gradient test solved!

The problem was actually in the fortran spectral
library of pyKdV (an implicit simple precision
conversion in spectraLib:specDDiag)