You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C:\Users\larsoner\python\mne-python\mne\dipole.py:docstring of mne.dipole.Dipole:98: WARNING: autosummary: failed to import crop.
Possible hints:
* ValueError: not enough values to unpack (expected 2, got 1)
* ModuleNotFoundError: No module named 'crop'
* ModuleNotFoundError: No module named 'mne.Dipole.crop'; 'mne.Dipole' is not a package
* KeyError: 'crop'
* AttributeError: module 'mne' has no attribute 'crop'
* ModuleNotFoundError: No module named 'mne.crop'
* AttributeError: module 'mne.Dipole' has no attribute 'crop'
mne.Dipole.cropis a valid method and is documented properly on Linux. I think it's driven by the following behavior on Windows -- namely, that if you try import mne.Dipole Python imports mne/dipole.py module as mne.Dipole:
>>> import mne
>>> mne.Dipole # correct!
<class 'mne.dipole.Dipole'>
>>> import mne.Dipole
>>> mne.Dipole # bad!
<module 'mne.Dipole' from 'C:\\Users\\larsoner\\python\\mne-python\\mne\\Dipole.py'>
>>> from mne import Dipole # bad enough, but continue...
>>> Dipole # also bad!
<module 'mne.Dipole' from 'C:\\Users\\larsoner\\python\\mne-python\\mne\\Dipole.py'>
I think autosummary is doing some module importing under the hood here that is having this effect. I'm not sure if it's possible to directly try mne.dipole.Dipole or mne.Dipolebefore trying to import mne.Dipole, as that would fix the problem...?
How to Reproduce
I can try to come up with a MWE if it's not obvious that there is some existing workaround or what the problem is. I'm not sure it will be easy, though, as which errors we get for which classes appears to change run-to-run :(
Environment Information
At least sphinx 5.3 and the latest release (tested both).
I've considered documenting mne.Dipole at mne.dipole.Dipole in the docs instead, but we really want this (and other classes with the same problem) in the root namespace. We also want mne.dipole to be public because some dipole-related functions live there and shouldn't live in the root mne namespace.
Describe the bug
We have
mne/dipole.pyin which there is aDipoleclass defined. We import this class (and.dipole) inmne/__init__.py, and document withautosummary/autodocthemne.Dipoleclass in the root namespace. On Windows (case-insensitive), we have the following problem, which just started show up on April 17th-ish in our builds:mne.Dipole.cropis a valid method and is documented properly on Linux. I think it's driven by the following behavior on Windows -- namely, that if you tryimport mne.DipolePython importsmne/dipole.pymodule asmne.Dipole:I think
autosummaryis doing some module importing under the hood here that is having this effect. I'm not sure if it's possible to directly trymne.dipole.Dipoleormne.Dipolebefore trying toimport mne.Dipole, as that would fix the problem...?How to Reproduce
I can try to come up with a MWE if it's not obvious that there is some existing workaround or what the problem is. I'm not sure it will be easy, though, as which errors we get for which classes appears to change run-to-run :(
Environment Information
Sphinx extensions
Additional context
mne.Dipoleatmne.dipole.Dipolein the docs instead, but we really want this (and other classes with the same problem) in the root namespace. We also wantmne.dipoleto be public because some dipole-related functions live there and shouldn't live in the rootmnenamespace.