Closed kolia closed 3 years ago
https://github.com/beacon-biosignals/PyMNE.jl/blob/bc1a70d720af2a05382c02b1ce857f72354a752c/src/PyMNE.jl#L35 is likely the issue -- thanks @ericphanson
For kicks I changed the module def to
module PyMNE_doodle
function __init__()
@eval using PyMNE
end
end
and then precompilation works.
Interesting. I'm not sure if there is an easy way to avoid this. But at the very least, we can add this information to the documentation.
This is due to how we fetch the names from the top-level MNE Python namespace to define them at the top level in the Julia module. The problem is that, until the module is initialized (i.e. __init__()
is called), the MNE pointer is null, so we don't know what the names are. Thus we have to defer that step until initialization. It's certainly not ideal; definitely open to suggestions for how to do that differently, but in the meantime I'm not sure we can do better. As Phillip said, we can at least document it.
So, I have a
PyMNE_doodle
project that just depends onPyMNE
, that contains amodule PyMNE_doodle
that just importsPyMNE
. I get that lovely error on precompilation ofPyMNE_doodle
, even thoughusing PyMNE
works fine.