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

docstrings for carla #2752

Open
HarryWindsor opened this issue Apr 16, 2020 · 6 comments
Open

docstrings for carla #2752

HarryWindsor opened this issue Apr 16, 2020 · 6 comments

Comments

@HarryWindsor
Copy link

@HarryWindsor HarryWindsor commented Apr 16, 2020

Is is possible to include the docs from https://carla.readthedocs.io/en/latest/python_api/#carla.Actor in the python library? I would prefer using the docs in my IDE rather than jumping into the browser when I have to look something up.

Thank you.

@pperle
Copy link

@pperle pperle commented Apr 20, 2020

You could try using Pycharms external documentation feature. The URL should look something like that https://carla.readthedocs.io/en/latest/python_api/#carla.{class.name}.{function.name}.

@sergi-e sergi-e self-assigned this Apr 23, 2020
@sergi-e
Copy link
Contributor

@sergi-e sergi-e commented Apr 23, 2020

Hi, @HarryWindsor !

Did the solution provided by @pperle served you well?

@Alby407
Copy link

@Alby407 Alby407 commented Apr 24, 2020

This does not work. PyCharm won't give any information when for example hovering over carla.World. If I manually go to e.g. https://carla.readthedocs.io/en/latest/python_api/#carla.World, it works.

@pperle
Copy link

@pperle pperle commented May 1, 2020

@Alby407 you are right, the URL I posted does not work for classes, only for their functions. For classes, there is one dot to many https://carla.readthedocs.io/en/latest/python_api/#carla.World..
I think the right parameter to use would be {element.qname} - full-qualified name of element under caret. The problem is that the fully-qualified name is not carla.World but carla.libcarla.World which does not match the doc URL (and even this would not fix the problem, looks like PyCharm has problems parsing the docs).

The right solution would be to include the docs.

@pperle
Copy link

@pperle pperle commented May 1, 2020

Inspired by this post I tried to add the docstring from carla/PythonAPI/docs/*.yml to the python stub. You can find the code here: https://github.com/pperle/carla/tree/docstrings_py . It is hacky, I know but it works well enough for me at the moment.

If anyone is interested here is the compiled Linux version carla-0.9.9-py3.5-linux-x86_64.egg.zip. The only thing that does not work are the type hints.

Example preview in PyCharm:
image

@germanros1987
Copy link
Member

@germanros1987 germanros1987 commented Jun 26, 2020

@pperle you have ran 90% of this marathon...would you like to finish it by making a PR to CARLA?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.