Skip to content

allow adding a preamble for try_examples #293

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

keewis
Copy link
Contributor

@keewis keewis commented May 8, 2025

As requested by @agriyakhetarpal in pydata/xarray#10299, this is my very simple attempt at supporting a "preamble" feature for try-examples. The main use case is importing modules, setting up a rng with a seed, and other configuration (very similar to pytest autouse fixtures that modify the doctest_namespace).

@keewis keewis marked this pull request as draft May 8, 2025 21:54
@keewis
Copy link
Contributor Author

keewis commented May 10, 2025

(FYI the only reason this is a draft is because I didn't really do any additional work like figuring out whether there should be an option in conf.py, or add documentation. Either way feel free to take over the PR if you'd like.)

@keewis
Copy link
Contributor Author

keewis commented May 21, 2025

@agriyakhetarpal, any chance you might have time to look at this? I believe that's the only thing left before I can merge the xarray PR.

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.

1 participant