@@ -183,25 +183,28 @@ def matplotlib_reduced_latex_scraper(block, block_vars, gallery_conf,
183
183
184
184
185
185
sphinx_gallery_conf = {
186
+ 'backreferences_dir' :Path ('api' )/ Path ('_as_gen' ),
187
+ # Compression is a significant effort that we skip for local and CI builds.
188
+ 'compress_images' : ('thumbnails' ,'images' )if is_release_build else (),
189
+ 'doc_module' : ('matplotlib' ,'mpl_toolkits' ),
186
190
'examples_dirs' : ['../examples' ,'../tutorials' ,'../plot_types' ],
187
191
'filename_pattern' :'^((?!sgskip).)*$' ,
188
192
'gallery_dirs' : ['gallery' ,'tutorials' ,'plot_types' ],
189
- 'doc_module' : ('matplotlib' ,'mpl_toolkits' ),
190
- 'reference_url' : {
191
- 'matplotlib' :None ,
192
- },
193
- 'backreferences_dir' :Path ('api' )/ Path ('_as_gen' ),
194
- 'subsection_order' :gallery_order .sectionorder ,
195
- 'within_subsection_order' :gallery_order .subsectionorder ,
196
- 'remove_config_comments' :True ,
197
- 'min_reported_time' :1 ,
198
- 'thumbnail_size' : (320 ,224 ),
199
193
'image_scrapers' : (matplotlib_reduced_latex_scraper , ),
200
- # Compression is a significant effort that we skip for local and CI builds.
201
- 'compress_images' : ('thumbnails' ,'images' )if is_release_build else (),
202
- 'matplotlib_animations' :True ,
203
194
'image_srcset' : ["2x" ],
204
195
'junit' :'../test-results/sphinx-gallery/junit.xml' if CIRCLECI else '' ,
196
+ 'matplotlib_animations' :True ,
197
+ 'min_reported_time' :1 ,
198
+ 'reference_url' : {'matplotlib' :None },
199
+ 'remove_config_comments' :True ,
200
+ 'reset_modules' : (
201
+ 'matplotlib' ,
202
+ # clear basic_units module to re-register with unit registry on import
203
+ lambda gallery_conf ,fname :sys .modules .pop ('basic_units' ,None )
204
+ ),
205
+ 'subsection_order' :gallery_order .sectionorder ,
206
+ 'thumbnail_size' : (320 ,224 ),
207
+ 'within_subsection_order' :gallery_order .subsectionorder ,
205
208
}
206
209
207
210
mathmpl_fontsize = 11.0