@@ -228,22 +228,6 @@ def _check_dependencies():
228228}
229229
230230
231- # Sphinx gallery configuration
232-
233- def matplotlib_reduced_latex_scraper (block , block_vars , gallery_conf ,
234- ** kwargs ):
235- """
236- Reduce srcset when creating a PDF.
237-
238- Because sphinx-gallery runs *very* early, we cannot modify this even in the
239- earliest builder-inited signal. Thus we do it at scraping time.
240- """
241- from sphinx_gallery .scrapers import matplotlib_scraper
242-
243- if gallery_conf ['builder_name' ] == 'latex' :
244- gallery_conf ['image_srcset' ] = []
245- return matplotlib_scraper (block , block_vars , gallery_conf , ** kwargs )
246-
247231gallery_dirs = [f'{ ed } ' for ed in
248232 ['gallery' , 'tutorials' , 'plot_types' , 'users/explain' ]
249233 if f'{ ed } /*' not in skip_subdirs ]
@@ -261,7 +245,7 @@ def matplotlib_reduced_latex_scraper(block, block_vars, gallery_conf,
261245 'examples_dirs' : example_dirs ,
262246 'filename_pattern' : '^((?!sgskip).)*$' ,
263247 'gallery_dirs' : gallery_dirs ,
264- 'image_scrapers' : (matplotlib_reduced_latex_scraper , ),
248+ 'image_scrapers' : ("sphinxext.util. matplotlib_reduced_latex_scraper" , ),
265249 'image_srcset' : ["2x" ],
266250 'junit' : '../test-results/sphinx-gallery/junit.xml' if CIRCLECI else '' ,
267251 'matplotlib_animations' : True ,
@@ -272,11 +256,11 @@ def matplotlib_reduced_latex_scraper(block, block_vars, gallery_conf,
272256 'reset_modules' : (
273257 'matplotlib' ,
274258 # clear basic_units module to re-register with unit registry on import
275- lambda gallery_conf , fname : sys . modules . pop ( 'basic_units' , None )
259+ "sphinxext.util.clear_basic_unit"
276260 ),
277- 'subsection_order' : gallery_order .sectionorder ,
261+ 'subsection_order' : "sphinxext. gallery_order.sectionorder" ,
278262 'thumbnail_size' : (320 , 224 ),
279- 'within_subsection_order' : gallery_order .subsectionorder ,
263+ 'within_subsection_order' : "sphinxext. gallery_order.subsectionorder" ,
280264 'capture_repr' : (),
281265 'copyfile_regex' : r'.*\.rst' ,
282266}
0 commit comments