How to pass an array in Psi4 plugin development?

I’m trying to develop a Psi4 plugin where I want to pass a NumPy array of doubles along with the ref_wfn, but I couldn’t find any API for that, It’s accepting wfn only.

my_wfn = psi4.core.plugin('my_plugin.so', ref_wfn)

and

extern "C" PSI_API
SharedWavefunction ddcc_psi4(SharedWavefunction ref_wfn, Options& options)
{
    int print = options.get_int("PRINT");
    return ref_wfn;
}

Even I tried to change these arguments but it’s still the same it seems there’s some abstract layer between these two codes.

The plugin interface is admittedly pretty limited. What you can do if you have a numpy array Py-side is to wfn.set_variable("SOME LABEL IN CAPS", my_np_array) . That’ll get converted to a psi4.core.Matrix and attached to the wfn, passed to the plugin, then you can retrieve it as wfn.variable("SOME LABEL IN CAPS").