Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation generated with Sphinx #46

Open
tvatter opened this issue Nov 19, 2019 · 0 comments
Open

Documentation generated with Sphinx #46

tvatter opened this issue Nov 19, 2019 · 0 comments

Comments

@tvatter
Copy link

tvatter commented Nov 19, 2019

Let's say that I have a C++ class myclass with a method double loglik(const Eigen::MatrixXd& u). To expose this method in python, I have something like .def("loglik", &myclass::loglik, "computes the log-likelihood.", py::arg("u")), which works fine. In other words, when doing help(mymodule.myclass), I see something like loglik(self: mymodule.myclass, u: numpy.ndarray[float64[m, n]]). However, when generating the documentation with Sphinx, the generated signature is loglik(self, u, n]]).

Similarly, I have a method in C++ with some argument const Eigen::MatrixXd& u = Eigen::MatrixXd() (i.e., the only difference is the "default"), which I expose in python using py::arg("u") = Eigen::MatrixXd(), and again this works fine, but the generated signature for the documentation is myfunction(self, u, n]] = array[, dtype])...

And it does not stop here. The same class has a constructor taking an argument const Eigen::MatrixXd& u, which I expose in python using .def(py::init<const Eigen::MatrixXd&>(), "my constructor", py::arg("u")). In this case, the signature generated by Sphinx is __init__(self: mymodule.myclass, u: numpy.ndarray[float64[m, n]]), so this one works as expected...

What am I missing here?

@tvatter tvatter changed the title Generated documentation Documentation generated with Sphinx Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant