-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
MAINT Fix full doc build by avoiding plot_set_output.py side-effect #24654
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
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.
Thank you for the fix. LGTM
# %% | ||
# This resets `transform_output` to its default value to avoid impacting other | ||
# examples when generating the scikit-learn documentation | ||
set_config(transform_output="default") |
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 surprising to me. I thought the examples run in separate processes.
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.
As far as I know this is not the case: there is an exec
somewhere that runs all the code from all the examples in the same interpreter. For example this is why sphinx-gallery has some reset functionality to clean-up before each example (e.g. closing all matplotlib figures): https://sphinx-gallery.github.io/stable/advanced.html#resetting-before-each-example
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.
LGTM. Thank you, @lesteve.
Another possibility would be to use the context manager where we would not have to comment. The downside is the extra indent. I am merging as-is to have the documentation running but we could come back to it if necessary. |
Thanks @lesteve |
This should fix #24652 by avoiding setting
transform_output
to examples running afterplot_set_output.py