Jupyter Notebook Python auto docstring generation with triple quotation
Asked Answered
R

1

17

I'm working in a jupyter notebook using python and trying to use the auto-documentation function to generate docstrings like below. When working in an IDE like pycharm a triple quotation + Enter underneath the function generates docstrings like shown below.

def test_function(df: pd.DataFrame, probs: dict) -> int:
    """
    :param df: 
    :param probs: 
    :return: 
    """

Currently my output from the notebook gives the output below and does not parse any arguments inside the function.

def test_function(df: pd.DataFrame, probs: dict) -> int:
    """

    """
Rema answered 13/6, 2019 at 10:38 Comment(1)
try #54595279Clavus
F
1

You can have that functionality in VScode, sublime, pytorch and other IDEs but not in jupyter the closest solution I found was to install nbextensions and use snippets to add a docstring template. it decreases typing by 50% but still not auto generating.

Fairtrade answered 11/4, 2021 at 12:10 Comment(1)
pytorch is an IDE ? Do you mean PyCharm ?Demark

© 2022 - 2024 — McMap. All rights reserved.