DOC: plot-directive warning filter option#27076
DOC: plot-directive warning filter option#27076story645 wants to merge 1 commit intomatplotlib:mainfrom
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. |
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 to
9b130e0
Compare
|
sphinx-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