question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Docstrings not showing correctly

See original GitHub issue

Which version are you running? The lastest version is on Github. Pip is for major releases.

0.3.14b0

Describe the bug Running help(pta.adx) will correctly show the __doc__.

However, the way docstrings are assigned (manually assigning to __doc__ of the function) causes IDE completion to not show the docstring correctly.

2021-09-28-200456_559x216_scrot

To Reproduce Use VSCode with python extension, use virtualenv with pandas_ta installed and use a very simple sample-snippet like the below.

import pandas_ta as pta

pta.adx

Uppon opening the parenteses after ADX, the docstring should show. Also on hover on the method, the docstring should show (but only the “one line” after the function header is showing).

Expected behavior Docstring will also show up as part of the autocompletion.

Screenshots 2021-09-28-200456_559x216_scrot

Same behaviour also shows on pycharm - so it’s apparently not an editor issue. 2021-09-28-201617_419x304_scrot

Additional context One can argue that it’s a problem of the the IDE - but it works fine for other packages …

On top of this, IDE completion for “Dataframe extension mode” does not work at all … but i suspect that’s an issue with pandas more than with pandas_ta).

Also - i think it would be nice to have a “full” documentation build based on the available docstrings that’s available as website (like readthedocs.io or github pages…). While it’ll seem sufficient to point users to “run help(pta.adx)” - having a webpage that allows to search for things in a “decently rendered” way would improve usability.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
xmatthiascommented, Oct 20, 2021

seems to work great (although i must admit, i’ve only tested a handful of indicators i commonly use) 👍

1reaction
twopirllccommented, Nov 17, 2021

@pssolanki111,

i used shpinx to build the docs for my library (for polygon.io financial data APIs) and it works so well.

I am aware of Sphinx, just little xp with it. Thanks for providing reference links. 😎

Thanks, KJ

Read more comments on GitHub >

github_iconTop Results From Across the Web

vscode docstrings not appearing properly - Stack Overflow
When I write a docstring, it should show something like this. Working docstring. Instead, my docstrings are not being formatted properly, and I ......
Read more >
PyCharm google docstring formatting is not rendering ...
I copied docstring examples (google-style) from sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html and tried to render them in PyCharm with ...
Read more >
Troubleshooting - mkdocstrings
Some objects are not rendered (they do not appear in the generated docs)¤ · Make sure the configuration options of the handler are...
Read more >
3 Easy Steps to Folding Docstrings in VSCode
Programmers using VSCode should add “docstrings” to their ... The code now has a full docstring which will be displayed correctly in VSCode ......
Read more >
Python Docstrings - GeeksforGeeks
Python Docstrings · The doc string line should begin with a capital letter and end with a period. · The first line should...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found