Details
-
Type:
Bug
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: meas_mosaic, validate_drp
-
Labels:None
-
Story Points:0.5
-
Epic Link:
-
Team:SQuaRE
Description
meas.mosaic.utils does a module-level import of matplotlib and sets the backend to Agg.
a) Specifically the matplotlib.use("Agg") line should be removed.
It has no effect if the user has already loaded a backend, and spews a big chunk of distracting warnings.
b) The overall import of matplotlib should not happen at the module level, because that code gets run when importing the module. Importing the module happens even just opening a Butler object view to the repo. Specifically, meas_mosaic gets imported by just the following code.
import os
|
import lsst.afw.display as afwDisplay
|
from lsst.daf.persistence import Butler
|
|
repo = os.getenv('REPO')
|
butler = Butler(repo)
|
Philosophically I don't believe that opening a Butler should trigger setting up matplotlib.
Editorial: I believe that all plotting imports should be protected and separated from the data analysis. But this implies a refactoring that may not be justified given the imminent replacement by jointcal
Attachments
Issue Links
- is triggering
-
DM-15429 Assertion failure in meas_mosaic diagnostics
- Done
Good point. Considering.