I am trying to install the latest weekly release of the lsst distribution on a cluster. This installation is exiting with an error for the analysis_drp package. I am attaching the last few lines of the terminal output as well as the full build.log below
2.99s call tests/test_scatterPlot.py::ScatterPlotWithTwoHistsTaskTestCase::test_ScatterPlotWithTwoHistsTask
0.97s call python/lsst/analysis/drp/scatterPlot.py::FLAKE8
0.82s call python/lsst/analysis/drp/skyPlot.py::FLAKE8
0.81s call python/lsst/analysis/drp/colorColorFitPlot.py::FLAKE8
0.78s call python/lsst/analysis/drp/histPlot.py::FLAKE8
=========================== short test summary info ============================
FAILED tests/test_scatterPlot.py::ScatterPlotWithTwoHistsTaskTestCase::test_ScatterPlotWithTwoHistsTask
============ 1 failed, 23 passed, 136 warnings in 62.76s (0:01:02) =============
Global pytest run: failed with 1
Failed test output:
Global pytest output is in /home/a_thakur/LSST/stack/miniconda3-py38_4.9.2-3.0.0/EupsBuildDir/Linux64/analysis_drp-g3ef4a34ec4+080ed862a4/analysis_drp-g3ef4a34ec4+080ed862a4/tests/.tests/pytest-analysis_drp.xml.failed
The following tests failed:
/home/a_thakur/LSST/stack/miniconda3-py38_4.9.2-3.0.0/EupsBuildDir/Linux64/analysis_drp-g3ef4a34ec4+080ed862a4/analysis_drp-g3ef4a34ec4+080ed862a4/tests/.tests/pytest-analysis_drp.xml.failed
1 tests failed
scons: *** [checkTestStatus] Error 1
scons: building terminated because of errors.
Can you attach /home/a_thakur/LSST/stack/miniconda3-py38_4.9.2-3.0.0/EupsBuildDir/Linux64/analysis_drp-g3ef4a34ec4+080ed862a4/analysis_drp-g3ef4a34ec4+080ed862a4/tests/data/test_scatterPlot.png and /home/a_thakur/LSST/stack/miniconda3-py38_4.9.2-3.0.0/EupsBuildDir/Linux64/analysis_drp-g3ef4a34ec4+080ed862a4/analysis_drp-g3ef4a34ec4+080ed862a4/tests/data/test_scatterPlot-failed-diff.png, as mentioned in the error message?
I’m guessing you have some personalized matplotlib configuration that is causing the test to fail.
That diff makes it look like slight font/spacing changes are the problem. We may need to change the test to be 1) more self-contained and less environment-dependent or 2) more tolerant of slight differences like this.
=================================== FAILURES ===================================
_____ ScatterPlotWithTwoHistsTaskTestCase.test_ScatterPlotWithTwoHistsTask _____
[gw22] linux -- Python 3.8.13 /home/a_thakur/LSST/conda/miniconda3-py38_4.9.2/envs/lsst-scipipe-3.0.0/bin/python3.8
self = <test_scatterPlot.ScatterPlotWithTwoHistsTaskTestCase testMethod=test_ScatterPlotWithTwoHistsTask>
def test_ScatterPlotWithTwoHistsTask(self):
plt.rcParams.update(plt.rcParamsDefault)
result = self.task.run(self.data,
dataId={},
runName="test",
skymap=None,
tableName="test",
bands=self.bands,
plotName="test")
filename_figure_tmp = os.path.join(self.testDir, "test_scatterPlot.png")
result.scatterPlot.savefig(filename_figure_tmp)
diff = compare_images(filename_figure_tmp, filename_figure_ref, 0)
if diff is not None:
> raise ImageComparisonFailure(diff)
E matplotlib.testing.exceptions.ImageComparisonFailure: Error: Image files did not match.
E RMS Value: 11.985320918131878
E Expected:
E /home/a_thakur/LSST/stack/miniconda3-py38_4.9.2-3.0.0/EupsBuildDir/Linux64/analysis_drp-g3ef4a34ec4+080ed862a4/analysis_drp-g3ef4a34ec4+080ed862a4/tests/test_output9ld3it_i/test_scatterPlot.png
E Actual:
E /home/a_thakur/LSST/stack/miniconda3-py38_4.9.2-3.0.0/EupsBuildDir/Linux64/analysis_drp-g3ef4a34ec4+080ed862a4/analysis_drp-g3ef4a34ec4+080ed862a4/tests/data/test_scatterPlot.png
E Difference:
E /home/a_thakur/LSST/stack/miniconda3-py38_4.9.2-3.0.0/EupsBuildDir/Linux64/analysis_drp-g3ef4a34ec4+080ed862a4/analysis_drp-g3ef4a34ec4+080ed862a4/tests/data/test_scatterPlot-failed-diff.png
E Tolerance:
E 0
tests/test_scatterPlot.py:124: ImageComparisonFailure
@dtaranu it looks like you wrote this test so would you care to comment?
I had a similar issue because the packages in my local site-packages directory were of a different version from that in the rubin-env and the packages in the local directory took precedence. It is likely that the next weekly will also have this issue, but one way to get around it is to update the packages (mostly numpy and matplotlib) in your local directory or to temporarily move them elsewhere. None of these suggestions are clean, I agree.
I have filed a ticket for this issue. In the meantime, it seems that the cause is having an older, local matplotlib installed somewhere (Arun had 3.4.3 vs 3.5.1), or potentially a .matplotlibrc override.
I updated the matplotlib and numpy versions in site-packages to match the versions needed by the stack, but the installation still errors out with the same message.
I installed matplotlib 3.4.3 locally and got the same error with almost exactly the same difference (11.985321431153329), so I’m not sure what else it could be. Nonetheless, we’ll have a fix out for the next weekly.