Description
With #2093 requirements, such as matplotlib, have been made optional. This means that not having matplotlib should not stop users installing and using CIL, unless they explicitly try to use functionality that depends on it.
In the above PR, code like below has been added, with the attempt to give the user some guidance on how to install such dependency.
|
try: |
|
import matplotlib.pyplot as plt |
|
except ImportError as exc: |
|
msg = "matplotlib-base (e.g. `conda install conda-forge::matplotlib-base`)" |
|
raise ImportError(f"Please install {msg}") from exc |
This is not necessary. An ImportError error message should be sufficient to explain where the problem is. We could maintain, and we do, a list of optional prerequisites and instructions on how to install them.
The suggestion is therefore, to revert the adding of the try/except that changes the ImportError message introduced in #2093
Environment
import cil, sys
print(cil.version.version, cil.version.commit_hash, sys.version, sys.platform)
Description
With #2093 requirements, such as
matplotlib, have been made optional. This means that not havingmatplotlibshould not stop users installing and using CIL, unless they explicitly try to use functionality that depends on it.In the above PR, code like below has been added, with the attempt to give the user some guidance on how to install such dependency.
CIL/Wrappers/Python/cil/processors/CofR_image_sharpness.py
Lines 233 to 237 in 126efd3
This is not necessary. An
ImportErrorerror message should be sufficient to explain where the problem is. We could maintain, and we do, a list of optional prerequisites and instructions on how to install them.The suggestion is therefore, to revert the adding of the
try/exceptthat changes theImportErrormessage introduced in #2093Environment