Jupyter笔记本Python自动生成带三重引号的docstring
我在一个使用python的jupyter笔记本中工作,并尝试使用自动文档功能生成docstring,如下所示。在像pycharm这样的IDE中工作时,函数会生成如下所示的docstringJupyter笔记本Python自动生成带三重引号的docstring,python,jupyter-notebook,documentation,jupyter,documentation-generation,Python,Jupyter Notebook,Documentation,Jupyter,Documentation Generation,我在一个使用python的jupyter笔记本中工作,并尝试使用自动文档功能生成docstring,如下所示。在像pycharm这样的IDE中工作时,函数会生成如下所示的docstring def test_function(df: pd.DataFrame, probs: dict) -> int: """ :param df: :param probs: :return: """ 目前,我在笔记本中的输出给出了下面的输出,并且没有解析函数
def test_function(df: pd.DataFrame, probs: dict) -> int:
"""
:param df:
:param probs:
:return:
"""
目前,我在笔记本中的输出给出了下面的输出,并且没有解析函数中的任何参数
def test_function(df: pd.DataFrame, probs: dict) -> int:
"""
"""
您可以在VScode、sublime、pytorch和其他IDE中使用该功能,但在jupyter中没有。我找到的最接近的解决方案是安装nbextensions,并使用片段添加docstring模板。它减少了50%的输入,但仍然不能自动生成。试试看