LumiSpy / lumispy

Luminescence data analysis with HyperSpy.
https://lumispy.org
GNU General Public License v3.0
26 stars 17 forks source link

Fix slicing of energy/wavenumber signal with isig #156

Closed jlaehne closed 1 year ago

jlaehne commented 1 year ago

Description of the change

Fixes #155.

.isig[] was failing on signals converted using to_eV() or to_invcm().

For tests to run, deprecated --use-feature=2020-resolver had to be removed from PIP_ARGS in workflows/tests.yml

Progress of the PR

Minimal example of the bug fix or the new feature

import hyperspy.api as hs
S = hs.signals.Signal1D(np.arange(100),axes=[{'axis': np.arange(100)+300}])
S.set_signal_type("CL")
S.to_eV(inplace=True)
S.isig[3.251:4.052]
codecov-commenter commented 1 year ago

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage :thumbsup:

Coverage data is based on head (d7a90ca) compared to base (58ade09). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #156 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 11 11 Lines 550 550 ========================================= Hits 550 550 ``` | [Impacted Files](https://codecov.io/gh/LumiSpy/lumispy/pull/156?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=LumiSpy) | Coverage Δ | | |---|---|---| | [lumispy/utils/axes.py](https://codecov.io/gh/LumiSpy/lumispy/pull/156/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=LumiSpy#diff-bHVtaXNweS91dGlscy9heGVzLnB5) | `100.00% <100.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=LumiSpy). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=LumiSpy)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

jlaehne commented 1 year ago

@mikelgr11 you had observed the problem reported in #155, which should fixed with this PR.