Skip to content

autodoc tries to import classes as modules? #3768

Closed
@amueller

Description

@amueller

After updating sphinx and numpydoc, I get

WARNING: /home/andy/checkout/scikit-learn/doc/modules/generated/sklearn.preprocessing.RobustScaler.rst:92: (WARNING/2) autodoc: failed to import method 'RobustScaler.__init__' from module 'sklearn.preprocessing.data.RobustScaler'; the following exception was raised:
Traceback (most recent call last):
  File "/home/andy/anaconda3/lib/python3.5/site-packages/sphinx/ext/autodoc.py", line 658, in import_object
    __import__(self.modname)
ImportError: No module named 'sklearn.preprocessing.data.RobustScaler'; 'sklearn.preprocessing.data' is not a package

for every class in the package.

It looks like the modname is wrong as it is the class and not the module. I'm not sure what should be imported at this point, though. The class? Importing a method doesn't seem to make a lot of sense...

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions