[Python] Python pickle scipy.interpolate.RBFInterpolator across operating systems (windows,...

Discussão em 'Python' iniciado por Stack, Julho 14, 2025.

  1. Stack

    Stack Membro Participativo

    I have created an RBFInterpolator object from the package scipy.interpolate and I can easily pickle it and unpickle it using the pickle package along with binary read and write.

    However, when I create it under windows and try to use it on a mac (and vice versa), I get following error message:

    TypeError: Invalid call to pythranized function `_build_evaluation_coefficients(float64[:, :] (is a view), float64[:, :] (is a view), str, float, int64[:, :], float64[:], float64[:])'
    Candidates are:

    - _build_evaluation_coefficients(float[:,:], float[:,:], str, float, int[:,:], float[:], float[:])


    The pickled object rbf loads well, and I can even inspect it, e.g. rbf.y, rbf.kernel etc. The above error is thrown when I try to interpolate at a point, rbf([[0., 0., 0.]]).

    Using python 3.12 on both win and mac.

    Can you help to find a different way of pickling / unpickling to become os-independent?

    Continue reading...

Compartilhe esta Página