8000 DOC: use custom module reset function to fix unit registration · matplotlib/matplotlib@cfdebd9 · GitHub
[go: up one dir, main page]

Skip to content

Commit cfdebd9

Browse files
committed
DOC: use custom module reset function to fix unit registration
As of sg 0.11 the unit registry is reset for each example. This also forces the basic_unit module to be fully re-imported to re-register in any example that use it.
1 parent 7117a16 commit cfdebd9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

doc/conf.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,11 @@ def matplotlib_reduced_latex_scraper(block, block_vars, gallery_conf,
191191
'matplotlib_animations': True,
192192
'image_srcset': ["2x"],
193193
'junit': '../test-results/sphinx-gallery/junit.xml' if CIRCLECI else '',
194+
'reset_modules': (
195+
'matplotlib',
196+
# clear basic_units module to re-register with unit registry on import
197+
lambda gallery_conf, fname: sys.modules.pop('basic_units', None)
198+
),
194199
}
195200

196201
mathmpl_fontsize = 11.0

0 commit comments

Comments
 (0)
0