Skip to content

DOC: source links in API reference #14178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
chris-b1 opened this issue Sep 7, 2016 · 5 comments · Fixed by #14200
Closed

DOC: source links in API reference #14178

chris-b1 opened this issue Sep 7, 2016 · 5 comments · Fixed by #14200
Labels
Milestone

Comments

@chris-b1
Copy link
Contributor

chris-b1 commented Sep 7, 2016

For example, from numpy.
http://docs.scipy.org/doc/numpy/reference/generated/numpy.take.html

I don't know enough about sphinx to know how hard/easy this is, but it may be nice.

@chris-b1
Copy link
Contributor Author

chris-b1 commented Sep 8, 2016

@jorisvandenbossche
Copy link
Member

Yes, we can certainly do something like that. We only have quite some dynamically generated methods, so not sure how it works for those (but at least it can work for the others).

@jorisvandenbossche
Copy link
Member

I was looking at some examples, and some give you not exactly what you want due to the implementation (eg read_csv pointing to _make_parser_function or Series.add to _flex_method_SERIES), but those are still a bit useful as in the end, it's how it is implemented.

But I also noticed that functions with deprecations point to the decorators. For example pandas.to_datetime (http://pandas-docs.github.io/pandas-docs-travis/generated/pandas.to_datetime.html) points to https://github.com/pydata/pandas/blob/master/pandas/util/decorators.py#L65-L91. @chris-b1 Do you know if this would be fixable?

@jorisvandenbossche
Copy link
Member

jorisvandenbossche commented Sep 14, 2016

Ah, apparently this was fixed in python 3.5 (https://bugs.python.org/issue1764286), so yet another reason to update our doc building to python 3 :-)
EDIT: apparently only inspect.getsource was fixed, and not inspect.getsourcefile, pitty ..

@jorisvandenbossche
Copy link
Member

jorisvandenbossche commented Sep 14, 2016

Hmm, maybe we can do something about it ourselves:

In [30]: inspect.getsourcefile(pandas.to_datetime)
Out[30]: '/home/joris/scipy/pandas/pandas/util/decorators.py'

In [31]: inspect.getsourcefile(inspect.unwrap(pandas.to_datetime))
Out[31]: '/home/joris/scipy/pandas/pandas/tseries/tools.py'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants