-
Notifications
You must be signed in to change notification settings - Fork 210
[MRG+1] Traceback message in Gallery output #77
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
Conversation
|
that's fine with me other option is to stop the doc build with a meaningful crash message |
It should be controlled by an option (just like the building of the |
My 2 cents: I think the current behaviour is fine for now. The general use case is to build all the examples to find all the broken ones rather than fail on the first error. Something I would actually find useful (not sure how easy this is): have a special image for broken examples allowing them to identify quite easily in the gallery. |
sphinx_gallery/gen_rst.py
Outdated
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.
Nitpick: in order not to do traceback.print_exc() and then traceback.format_exc() which is kind of doing the same thing twice, you can do:
formatted_exception = traceback.format_exc()
print(formatted_exception)
exception_msg = indent(formatted_exception, ' ' * 4)|
Now it's improved. |
The image thing is quite nice, although we can think about tweaking the "broken" image. I still get non fixed-width font in the warnings when generating the gallery locally though. |
|
I have to say not sure whether the technical term for it is fixed-font or not but basically what I was trying to say is that I would have the same font in the traceback and in the code cell. |
f363e74 to
2da5e45
Compare
|
As here I change some CSS I would like PR #80 to be merged first. This branch is already rebased to it, but it did not generate a branch dependency as I expected. |
|
is it possible to have the build stop if an example fails? to me that should be the default behavior. It happened to me too many times to push a website update with broken examples... it happens quickly when you have dozens of examples. |
|
I added the quick fail option to break the gallery build process as soon as an example trows an Exception, added the documentation what to put in the makefile for that. But I have not made it the default behavior, as building the complete gallery and scanning for the broken examples visually from the rendered website seems more intuitive for me. You can vote on that. |
doc/advanced_configuration.rst
Outdated
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.
visiulization
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.
take -> takes
display -> to display
|
besides LGTM |
sphinx_gallery/gen_rst.py
Outdated
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.
For readability, I would suggest being explicit about the keyword argument here, by writing:
..., lang='pytb')
|
I agree with your various design choices (in particular the default). +1 for merge. I have suggested a tiny style change. |
|
it's fine to merge as is for me thx @Titan-C |
doc/Makefile
Outdated
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.
maybe html-quick-fail in order not to mix - and _
|
My contribution for the 'quick_fail' naming: abort_on_example_error. |
|
Could you rebase on master so that we make sure no extra CSS changes has slipped through in this PR? |
|
broken_stamp.svg is not used now, but is the source of for the png file. Not sure if it will become useful in the future if we want to tune the image or if #61 The background of the image is black in the thumbnails because in the sphinx-classic css theme all body backgrounds are black, and the png image is transparent. |
examples/plot_raise.py
Outdated
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.
Singular seems more fitting here: Example that fails to execute
|
Overall, LGTM. +1 for merge (ideally, please address the comments of the others). |
|
fine with me |
This allows easy identification of failled examples in the gallery view
Sphinx with Pygments provides syntax highlighting for python traceback messages is the same way as for python code. Use those
The current gallery behavior is that when using the no plot flag during build the whole gallery building process is skipped. Now, all examples are parsed into rst files but not executed, embedding of links to documentation in not performed either
|
Rebased to master and comments addressed |
|
@agramfort was good with this. I am too. Let's merge! |
[MRG+1] Traceback message in Gallery output




This PR need comments.
First there is the situation of how to deal with a broken build #45, discussion shall continue there.
Here I address, for the moment, that the traceback of a broken example should be also printed in the HTML output of the gallery following my comment on #65 (comment)