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
Mayavi support #42
Mayavi support #42
Conversation
@Titan-C we're making progress here. Can you have a look? So far for us the images are moved to the bottom which is weird but besides this it works great. |
It looks ok. I would add a short example to show a plot in mayavi.
Do you mean bottom miss aligned? or bottom shown after the code? Because as part of adopting the notebook layout I put the images after the code. Are you doing the sprint during the holiday? I can go today. |
Are you doing the sprint during the holiday? I can go today.
We are at 'La paillasse' today:
https://github.com/mne-tools/mne-python/wiki/NeuroCoding-2015
|
done. Let's see if travis is happy
|
e2b1f0d
to
2a2f0d7
Compare
Travis is happy now |
FYI I added the |
let's wait for the PR to be merged. |
I did it as part of the commit that made Travis happy. Do you want me to undo the commit and split it up? |
Just a reminder at some point we also need to add support for |
yep !
|
#36 has been merged now and you need to rebase it seems like. |
Yeah will do today
|
6c1b335
to
73f1512
Compare
73f1512
to
4607f77
Compare
rebased and travis is happy. Ready for review |
try: | ||
from mayavi import mlab | ||
use_mayavi = True | ||
except ImportError, e: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not python 3 compatible and is old way of doing things in python 2. Slightly annoying that the tests pass, but oh well this is part of the doc generation and not really the sphinxgallery package ...
Since you are not using the exception you might as well just do:
except ImportError:
comments addressed. |
any more comment? |
done |
@@ -22,6 +22,7 @@ Contents: | |||
reference | |||
auto_examples/index | |||
tutorials/index | |||
auto_mayavi_examples/index |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but now this link will not exist unless mayavi is present... maybe it's just a sphinx warning so no big deal...
@@ -409,6 +409,8 @@ def embed_code_links(app, exception): | |||
"""Embed hyperlinks to documentation into example code""" | |||
if exception is not None: | |||
return | |||
if not app.builder.config.plot_gallery: | |||
return # no need to embed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed that in my previous reviews. Why don't you want to put hyperlinks inside the example in case plot_gallery is False? Is it because it can fail if there is a parsing error of the script ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
On 4 août 2015, at 09:35, Loïc Estève notifications@github.com wrote:
In sphinxgallery/docs_resolv.py:
@@ -409,6 +409,8 @@ def embed_code_links(app, exception):
"""Embed hyperlinks to documentation into example code"""
if exception is not None:
return
- if not app.builder.config.plot_gallery:
I missed that in my previous reviews. Why don't you want to put hyperlinks inside the example in case plot_gallery is False? Is it because it can fail if there is a parsing error of the script ?return # no need to embed
—
Reply to this email directly or view it on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then could you improve the comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And also because when writing narrative doc you don't want to plot and wait for all the embedding
On 4 août 2015, at 09:35, Loïc Estève notifications@github.com wrote:
In sphinxgallery/docs_resolv.py:
@@ -409,6 +409,8 @@ def embed_code_links(app, exception):
"""Embed hyperlinks to documentation into example code"""
if exception is not None:
return
- if not app.builder.config.plot_gallery:
I missed that in my previous reviews. Why don't you want to put hyperlinks inside the example in case plot_gallery is False? Is it because it can fail if there is a parsing error of the script ?return # no need to embed
—
Reply to this email directly or view it on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, is there a way to do the equivalent of matplotlib.use('Agg') so that the mayavi figures don't pop up while generating the doc? |
You want to set the mlab enfine as the offscreenengine. http://docs.enthought.com/mayavi/mayavi/auto/example_offscreen.html This should be easily done by the following: from mayavi import mlab
mlab.options.offscreen = True |
OK I just tried to generate the doc with the mayavi example and I got an error that the MNE-Python people know about ... mne-tools/mne-python#2062. The last comment on the issue seems to indicate that it works with pyface master, but is there any better option? For completeness I installed mayavi through Anaconda. For reference, here is the log from sphinx:
|
yeah I had to install pyface master ...
|
yeah I had to install pyface master ...
WTF
|
For completeness, pyface original issue (fixed in master) enthought/pyface#113. |
You don't actually need pyface master, pip install pyface fixed it for me. It's just that the version provided by conda is 4.4 which is from Dec 4, 2013 for some reason. |
Cool
|
OK I'll merge that as is and patch it up myself. |
thanks
|
patch to add mayavi support on top of #36