Skip to content

Commit

Permalink
EMD Velox: update error msg for missing sparse module
Browse files Browse the repository at this point in the history
  • Loading branch information
dbdurham authored Aug 26, 2024
1 parent d54f7d1 commit 79043a2
Showing 1 changed file with 4 additions and 2 deletions.
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 @@ def file_reader(
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 @@ def file_reader(
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

0 comments on commit 79043a2

Please sign in to comment.