小编Sol*_*e G的帖子

sphinx 警告:自动摘要:找不到该类的方法的存根文件。检查您的 autosummary_generate 设置

我有一个开源包,在不同的子模块上有很多类。所有类都有方法fittransform,并继承fit_transform自 sklearn。所有的类都遵循与副标题参数,属性,注释numpydoc,请参见,和方法的文档字符串,在这里我表fittransformfit_transform。我复制一个类的例子:

class DropFeatures(BaseEstimator, TransformerMixin):
    """
    Some description.

    Parameters
    ----------
    features_to_drop : str or list, default=None
        Variable(s) to be dropped from the dataframe

    Methods
    -------
    fit
    transform
    fit_transform
    """

    def __init__(self, features_to_drop: List[Union[str, int]]):

        some init parameters

    def fit(self, X: pd.DataFrame, y: pd.Series = None):
        """
        This transformer does not learn any parameter.

        Verifies that the input X is a pandas dataframe, and that the variables to
        drop …
Run Code Online (Sandbox Code Playgroud)

python python-sphinx numpydoc sphinx-napoleon

6
推荐指数
2
解决办法
1349
查看次数

标签 统计

numpydoc ×1

python ×1

python-sphinx ×1

sphinx-napoleon ×1