-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Investigate why some examples build properly in our gallery despite using numpy and not importing it explicitely. #8235
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
Comments
The |
I suspected something like this… I guess it is a really good thing no one else than matplotlib uses the plot_directive. |
If no one uses it perhaps we should just not add that header anymore :-) |
If someone fixes that file, two more easy fixes:
|
I use the plot directive quite a bit in my day-job docs and it is in both the numpy and scipy docs. Suspect the fix here is to make sure this file is run by the backend-driver test. |
I would rather deprecate this. You can do something like
|
I am 👎 on deprecating this. The plot directive is very useful for in-line plots where reducing boiler plate is generally good and changing this is going to cause a bunch of work for down-stream users. If we were writing it now no default imports would be reasonable, but it has been this way from 2010 (6f2860f) and I don't see the payoff being worth the down-stream cost. If we want to be strict in our docs, add a 'strict' flag that disables the imports (or just pass an empty string into plot_pre_code in the templates we use to generate the gallery). |
plot_pre_code is exactly there to avoid the need for boilerplate. |
If we finish the migration to sphinx-gallery, I don't think this function will be necessary anymore. |
@NelleV can you close this? I think that this issue is resolved since sphinx-gallery is building all of the examples etc. |
A recent pull request fixed an import problem in one of our pull request. The example was missing numpy, despite using it. After investigating, the example did generate the plot properly, suggesting some kind of hidden import somewhere.
Here is a link on the build example (Matplotlib 2.0.0)
http://matplotlib.org/examples/mplot3d/pathpatch3d_demo.html
The text was updated successfully, but these errors were encountered: