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

Conversation

dbdurham
Copy link

Description of the change

This is an update in response to Issue #296 "emd reader Velox ModuleNotFoundError." When attempting to load EDS Spectrum Image data from a Velox EMD file without the optional "sparse" dependency installed, a ModuleNotFoundError is raised which is confusing to some users. To clarify the issue, a try except statement was added around running the Velox EMD file reader and a new error message is printed.

Progress of the PR

  • Change implemented (can be split into several points),
  • update docstring (if appropriate),
  • update user guide (if appropriate),
  • add a changelog entry in the upcoming_changes folder (see upcoming_changes/README.rst),
  • Check formatting of the changelog entry (and eventual user guide changes) in the docs/readthedocs.org:rosettasciio build of this PR (link in github checks)
  • add tests,
  • ready for review.

Copy link

codecov bot commented Aug 28, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 87.66%. Comparing base (d54f7d1) to head (79043a2).

Files with missing lines Patch % Lines
rsciio/emd/_api.py 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #305      +/-   ##
==========================================
- Coverage   87.67%   87.66%   -0.02%     
==========================================
  Files          83       83              
  Lines       11149    11152       +3     
  Branches     2414     2414              
==========================================
+ Hits         9775     9776       +1     
- Misses        860      862       +2     
  Partials      514      514              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@ericpre ericpre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @dbdurham for the pull request, this looks good. Can you try to add a test in https://github.com/hyperspy/rosettasciio/blob/main/rsciio/tests/test_emd_velox.py to cover the code that you added? It will need to catch the error using pytest.raises but also update the pytest.importorskip("sparse") accordingly to enable running the test.
I am happy to do that if this helps.

Can you add a changelog entry? The instruction on how to do that are in https://github.com/hyperspy/rosettasciio/blob/main/upcoming_changes/README.rst.

@dbdurham
Copy link
Author

dbdurham commented Sep 4, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants