Open
Description
Sphinx Gallery now allows parallel execution of gallery examples. The plotly Orca renderer correctly outputs PNGs with the example filename as root, e.g., plot_my_example.png
.
However, the scraper grabs all PNGs from the example directory. So, if other plotly examples execute simultaneously, those PNGs may be "stolen" by the scraper.
To fix the issue, the scraper would have to be modified from:
examples_dir = os.path.dirname(block_vars["src_file"])
pngs = sorted(glob(os.path.join(examples_dir, "*.png")))
to
examples_dir = os.path.dirname(block_vars["src_file"])
fn_root, _ = os.path.splitext(block_vars["src_file"])
pngs = sorted(glob(os.path.join(examples_dir, f"{fn_root}_*.png")))
Note the more selective filter on the globbed PNGs.