Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
DOC: plot-directive warning filter option#27076
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
I don't understand why this would be a good idea? If we explicitly need to catch a warning can't we do it in the plot code? |
Yes, but that would distract from the plot code. In the original use case, the plot still works - the warnings were of the font not found/missing glyph but fallback variety. |
I don't think we should have code that warns in the docs unless we make it clear to users. If you have the distracting filter in there, at least it's clear to potential users that the warning may be triggered. |
story645 commentedOct 13, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
We already do, we just use simplefilters to keep it out of the doc builds. This was for the use cases where a bulk filter isn't appropriate. Though granted, I also kinda wrote those more as a debugging aide that's nice to have in the directive than necessarily something I think is broadly good practice. |
19ca024
to9b130e0
Comparesphinx-gallery/sphinx-gallery#930 seems like a more elegant version of this |
PR summary
Ended up not needing it in#26989, but figure an option to filter a warning might be useful? This is the most basic implementation
where the string input is whatever can be passed into warnings.filterwarning, Possibly needs tests.
PR checklist