首页 > 解决方案 > python docstring样式留下空格

问题描述

我正在使用文档字符串sphinx来记录项目。它通常工作正常,但正如您在下图中看到的那样,我在“参数”部分失去了很多空间。

有没有办法删除“参数”,同时将其保留在类文档字符串中?或者留下一个空行并将每个参数向左缩进?我尝试了几种选择,但它们似乎对这种风格没有影响

GASearchCV

编辑:这是文档字符串的样子:

class GASearchCV(ClassifierMixin, RegressorMixin):
    """
    Evolutionary optimization over hyperparameters.

    Long description..
    """

    def __init__(self,
                 estimator):
        """
        Parameters
        ----------
        estimator : estimator object, default=None
        estimator object implementing 'fit'
        The object to use to fit the data.
        """

谢谢!

标签: pythonpython-sphinxdocstringread-the-docs

解决方案


推荐阅读