Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EMD Velox: update error msg for missing sparse module #305

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions rsciio/emd/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@
try:
if is_EMD_Velox(file):
from ._emd_velox import FeiEMDReader

_logger.debug("EMD file is a Velox variant.")
emd_reader = FeiEMDReader(
lazy=lazy,
Expand All @@ -186,7 +185,10 @@
SI_dtype=SI_dtype,
load_SI_image_stack=load_SI_image_stack,
)
emd_reader.read_file(file)
try:
emd_reader.read_file(file)
except ModuleNotFoundError:
raise ModuleNotFoundError("The 'sparse' library was not found. To load EDS spectrum image data from Velox EMD files, 'sparse' must be installed")

Check warning on line 191 in rsciio/emd/_api.py

View check run for this annotation

Codecov / codecov/patch

rsciio/emd/_api.py#L190-L191

Added lines #L190 - L191 were not covered by tests
elif is_EMD_NCEM(file):
from ._emd_ncem import EMD_NCEM

Expand Down