Keck-DataReductionPipelines / KCWI_DRP

KCWI python DRP
BSD 3-Clause "New" or "Revised" License
9 stars 13 forks source link

The framework depends on pyqt5 #71

Open lucarizzi opened 3 years ago

lucarizzi commented 3 years ago

I found an unexpected dependency.

Once in a while, to test our installation procedure, I wipe out the entire anaconda installation and start from scratch.

After i did that and started running the drp, the framework failed with the message: File "/usr/local/lib/python3.7/dist-packages/matplotlib/backends/backend_qt5.py", line 15, in import matplotlib.backends.qt_editor.figureoptions as figureoptions File "/usr/local/lib/python3.7/dist-packages/matplotlib/backends/qt_editor/figureoptions.py", line 12, in

Turns out that the framework imports matplotlib and it uses the qt5 backend.

The fix is trivial

python3.7 -m pip install pyqt5

But I'd like to remove matplotlib from the framework.

MNBrod commented 3 years ago

The only direct call to matplotlib appears to be in /kcwidrp/data/Untitled.ipynb. Is that a needed file, or can we cut it out? If so, this fix is as simple as removing matplotlib from enviornment.yml and setup.py (also maybe requirements.txt)

lucarizzi commented 3 years ago

I think the matplotlib is called by the framework, not by the pipeline.

lucarizzi commented 3 years ago

File "/Users/lrizzi/anaconda3/envs/kcwidrp/lib/python3.7/site-packages/keckdrpframework/core/server_task.py", line 16, in import matplotlib.pyplot as plt File "/Users/lrizzi/anaconda3/envs/kcwidrp/lib/python3.7/site-packages/matplotlib/pyplot.py", line 2356, in switch_backend(rcParams["backend"]) File "/Users/lrizzi/anaconda3/envs/kcwidrp/lib/python3.7/site-packages/matplotlib/pyplot.py", line 221, in switch_backend backend_mod = importlib.import_module(backend_name)