Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Is there a way to specify custom backreferences in a docstring? #228

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
choldgraf opened this issue Apr 20, 2017 · 3 comments
Closed

Is there a way to specify custom backreferences in a docstring? #228

choldgraf opened this issue Apr 20, 2017 · 3 comments

Comments

@choldgraf
Copy link
Contributor

A couple of backreferences issues popping up on the MPL conversion!

I'm trying to get SG to replicate the backreferences style of plotting that MPL uses. But I'm running into two main things:

  1. Backreferences for any methods are not getting picked up (e.g. ax.scatter doesn't have any examples generated for it in the backrefs folder, while plt.scatter does, even though there are examples that use both)
  2. An issue I'm running into with matplotlib is that there are duplicates of many things. For example, there is the plt.scatter function, as well as the ax.scatter function, which is pretty much the same in spirit. In these cases, backreferences to one should really also be backreferences to another.

For #2 I'm not sure if / how to do this elegantly. Maybe one could specify a "link" between one function and another in the docstring, such that any backrefs for one function also show for another. So in the ax.scatter docstring I could put something like See also: matplotlib.pyplot.scatter <SG> and when generating backrefs it would find the <SG> and know to generate the plt.scatter backref examples for that method?

LMK if there are any thoughts or ideas on this issue! Slowly bringing the matplotlib docs towards sphinx gallery one error at a time :)

@GaelVaroquaux
Copy link
Contributor

GaelVaroquaux commented Apr 20, 2017 via email

@choldgraf
Copy link
Contributor Author

Ah I see. I wonder if this is actually a problem of imports then. Eg many if the mpl examples create an axis object with 'plt.subplots'. I don't think Sphinx Gallery would know to connect that axis object's methods with the Axes class in that case. Hmm.

@choldgraf
Copy link
Contributor Author

and in this case, I'm going to close this in favor of #205 because I think that's actually the culprit

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

No branches or pull requests

2 participants