Open azukov opened 6 months ago
The way I understand C++ extension modules is that if you want to import that way, you need to declare the submodule as a separate extension module, instead of using PyModule_AddObject
But if you define a separate extension module, I think you can't do
from orbit.core.orbit_utils import bunch_utils_functions
bunch_utils_functions.copyCoordsToInitCoordsAttr()
unless you create a __init__.py
under orbit/core/orbit_utils
that does from . import copyCoordsToInitCoordsAttr
I think I tried adding 'package' constant as mentioned in the above StackOverflow post and it worked.
ah, I haven't tried that. I'll check that solution
Currently if a C++ module has a submodule the import is not working properly as the module is not a package. E.g.
will give
The import from module itself works, following is OK:
Could be done following StackOverflow ?