IPython shows decorator argument list instead of function argument list
This appears to be related to Issue #215. The argument list still shows the generic (args, *kwargs) from the decorator..Though the doctring tends to have enough information, it would be nice to see the original list of arguments from the function to know which parameters are the kwargs, and which are positional args and what the defaults may be. Is that something easily achieved?
This also affects automodule/autoclass outputs in the doc.
This is a known issue. There's definitely a way to fix it, I think using 'wraps' from functools.... +1 for a PR / FIX
It doesn't seem like wraps from functools has anything obvious for parameter list. Perhaps this had to do with function objects not having any convenient attributes for parameter list like they do with name or doc ?
Have your tried this?
http://stackoverflow.com/questions/3687046/python-sphinx-autodoc-and-decorated-members On Dec 6, 2013 5:55 PM, "Hari Bhradwaj" [email protected] wrote:
It doesn't seem like wraps from functools has anything obvious for parameter list. Perhaps this had to do with function objects not having any convenient attributes for parameter list like they do with name or doc?
— Reply to this email directly or view it on GitHubhttps://github.com/mne-tools/mne-python/issues/963#issuecomment-30044702 .
+1 for fixing this. The problem happens also in sphinx cf.
http://martinos.org/mne/generated/mne.read_forward_solution.html#mne.read_forward_solution
Looks like the decorator package would work!.. I'll issue a PR in a bit.
Just issued a PR.. Both IPython and spyder's "object inspector" seem to see the right signature and docstrings now. Any ideas on how to write test for this specificallly?
I think visual inspection of the docs should suffice here. On Dec 8, 2013 8:06 PM, "Hari Bhradwaj" [email protected] wrote:
Just issued a PR.. Both IPython and spyder's "object inspector" seem to see the right signature and docstrings now. Any ideas on how to write test for this specificallly?
— Reply to this email directly or view it on GitHubhttps://github.com/mne-tools/mne-python/issues/963#issuecomment-30104480 .
Oops.. Travis CI build failed as it couldn't import the decorator module.. Will work on defaults..
All set with PR #967 being merged.