Default arguments for a function for module B of type module A #5010
Unanswered
vishwa2710
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello all!
I have a set of C++ repositories that utilize pybind11 to create python bindings.
https://github.com/open-space-collective
Specifically classes from Core are used heavily in other repos.
Everything compiles and runs fine the way it is setup currently.
However, when I try and run stubgen from mypy for the astrodynamics repo I get the following error:
OpenSpaceToolkitAstrodynamicsPy: Failed to import, skipping with error: arg(): could not convert default argument 'name: ostk::core::types::String' in method '<class 'ostk.astrodynamics.dynamics.Thruster'>.init' into a Python object (type not registered yet?)
This stems from the file Thruster.cpp where I am using
ostk::core::types::String
for a default value for one of the fields.This issue does not occur when importing the modules as we have the following init.py where we do
(Physics imports IO and Math, which in turn import Core).
Any ideas on how I can resolve this issue? I looked into https://pybind11.readthedocs.io/en/stable/advanced/misc.html#partitioning-code-over-multiple-extension-modules but I was unable to figure it out.
Beta Was this translation helpful? Give feedback.
All reactions