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

Axis conversion for TransientSpec #205

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

jlaehne
Copy link
Contributor

@jlaehne jlaehne commented Jan 1, 2024

Description of the change

Move axis conversion code to CommonLuminescence class to make it available to LuminescenceTransientSpectrum signals.

Handle inheritance for slicing of LuminescenceTransientSpectrum:

  • Create 1D version of signal_type = 'TransientSpec' (class TransientSpectrumCasting)
  • If TransientSpec is initialized in 1D with axes_manager[-1].units being a time unit, switch to LumiTransient class, otherwise switch to Luminescence class

Progress of the PR

@jlaehne jlaehne added this to the v0.2.3 milestone Jan 1, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jan 1, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (9c402c0) 100.00% compared to head (9b54af6) 99.48%.
Report is 2 commits behind head on main.

Files Patch % Lines
lumispy/signals/common_luminescence.py 97.53% 2 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##              main     #205      +/-   ##
===========================================
- Coverage   100.00%   99.48%   -0.52%     
===========================================
  Files           12       12              
  Lines          556      578      +22     
===========================================
+ Hits           556      575      +19     
- Misses           0        3       +3     

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

>>> S1.to_invcm(laser=325)
"""

def to_invcm_relative(self, laser=None, inplace=True, jacobian=False):

Check notice

Code scanning / CodeQL

Explicit returns mixed with implicit (fall through) returns Note

Mixing implicit and explicit returns may indicate an error as implicit returns always return None.
axis2 = UniformDataAxis(size=8, offset=0, scale=0.1, units='ns')
data = arange(80).reshape(8,10)
S1 = LumiTransientSpectrum(data, axes=[axis2, axis1])
S2 = S1.to_eV(inplace=True, jacobian=False)

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable S2 is not used.
# along with LumiSpy. If not, see <https://www.gnu.org/licenses/#GPL>.

import numpy as np
import pytest

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'pytest' is not used.
import pytest

from lumispy.signals import LumiSpectrum, LumiTransient, LumiTransientSpectrum
from hyperspy._signals.signal2d import Signal2D

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'Signal2D' is not used.

from lumispy.signals import LumiSpectrum, LumiTransient, LumiTransientSpectrum
from hyperspy._signals.signal2d import Signal2D
from numpy.testing import assert_allclose

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'assert_allclose' is not used.
@jlaehne jlaehne linked an issue Jan 29, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Slicing TransientSpec
2 participants