Skip to content

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

Merged
merged 2 commits into from
Oct 13, 2022

Conversation

lesteve
Copy link
Member

@lesteve lesteve commented Oct 13, 2022

This should fix #24652 by avoiding setting transform_output to examples running after plot_set_output.py

Copy link
Member

@thomasjpfan thomasjpfan left a 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")
Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member

@jjerphan jjerphan left a 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.

@glemaitre glemaitre merged commit 29d89f0 into scikit-learn:main Oct 13, 2022
@glemaitre
Copy link
Member

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.

@glemaitre
Copy link
Member

Thanks @lesteve

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

Successfully merging this pull request may close these issues.

Full documentation build fails since set_output('pandas') was merged
4 participants