Skip to content

Commit 40c3ec2

Browse files
committed
split lazy signals in separate file
1 parent fa60d89 commit 40c3ec2

13 files changed

Lines changed: 225 additions & 69 deletions

lumispy/signals/__init__.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,18 @@
1616
# You should have received a copy of the GNU General Public License
1717
# along with LumiSpy. If not, see <https://www.gnu.org/licenses/#GPL>.
1818

19-
from .luminescence_spectrum import LumiSpectrum, LazyLumiSpectrum
20-
from .cl_spectrum import CLSpectrum, LazyCLSpectrum
21-
from .cl_spectrum import CLSEMSpectrum, LazyCLSEMSpectrum
22-
from .cl_spectrum import CLSTEMSpectrum, LazyCLSTEMSpectrum
23-
from .pl_spectrum import PLSpectrum, LazyPLSpectrum
24-
from .el_spectrum import ELSpectrum, LazyELSpectrum
25-
from .luminescence_transient import LumiTransient, LazyLumiTransient
26-
from .luminescence_transientspec import LumiTransientSpectrum, LazyLumiTransientSpectrum
19+
from .luminescence_spectrum import LumiSpectrum
20+
from .lazy_luminescence_spectrum import LazyLumiSpectrum
21+
from .cl_spectrum import CLSpectrum, CLSEMSpectrum, CLSTEMSpectrum
22+
from .lazy_cl_spectrum import LazyCLSpectrum, LazyCLSEMSpectrum, LazyCLSTEMSpectrum
23+
from .pl_spectrum import PLSpectrum
24+
from .lazy_pl_spectrum import LazyPLSpectrum
25+
from .el_spectrum import ELSpectrum
26+
from .lazy_el_spectrum import LazyELSpectrum
27+
from .luminescence_transient import LumiTransient
28+
from .lazy_luminescence_transient import LazyLumiTransient
29+
from .luminescence_transientspec import LumiTransientSpectrum
30+
from .lazy_luminescence_transientspec import LazyLumiTransientSpectrum
2731

2832

2933
__all__ = [

lumispy/signals/cl_spectrum.py

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
# along with LumiSpy. If not, see <https://www.gnu.org/licenses/#GPL>.
1818

1919
"""
20-
Signal class for cathodoluminescence spectral data
21-
--------------------------------------------------
20+
Signal classes for cathodoluminescence spectral data
21+
----------------------------------------------------
2222
"""
2323

2424
import numpy as np
@@ -141,12 +141,6 @@ def remove_spikes(
141141
)
142142

143143

144-
class LazyCLSpectrum(LazySignal, CLSpectrum):
145-
"""**General lazy 1D cathodoluminescence signal class.**"""
146-
147-
_lazy = True
148-
149-
150144
"""SEM specific signal class for Cathodoluminescence spectral data.
151145
"""
152146

@@ -203,23 +197,7 @@ def correct_grating_shift(
203197
self.metadata.set_item("Signal.grating_corrected", True)
204198

205199

206-
class LazyCLSEMSpectrum(LazySignal, CLSEMSpectrum):
207-
"""**Lazy 1D scanning electron microscopy cathodoluminescence signal class.**"""
208-
209-
_lazy = True
210-
211-
212-
"""STEM specific signal class for Cathodoluminescence spectral data.
213-
"""
214-
215-
216200
class CLSTEMSpectrum(CLSpectrum):
217201
"""**1D scanning transmission electron microscopy cathodoluminescence signal class.**"""
218202

219203
_signal_type = "CL_STEM"
220-
221-
222-
class LazyCLSTEMSpectrum(LazySignal, CLSTEMSpectrum):
223-
"""**Lazy 1D scanning transmission electron microscopy cathodoluminescence signal class.**"""
224-
225-
_lazy = True

lumispy/signals/el_spectrum.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
--------------------------------------------------
2222
"""
2323

24-
from hyperspy._signals.lazy import LazySignal
25-
2624
from lumispy.signals import LumiSpectrum
2725

2826

@@ -31,9 +29,3 @@ class ELSpectrum(LumiSpectrum):
3129

3230
_signal_type = "EL"
3331
_signal_dimension = 1
34-
35-
36-
class LazyELSpectrum(LazySignal, ELSpectrum):
37-
"""**General lazy 1D electroluminescence signal class**"""
38-
39-
_lazy = True
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2019-2025 The LumiSpy developers
3+
#
4+
# This file is part of LumiSpy.
5+
#
6+
# LumiSpy is free software: you can redistribute it and/or modify
7+
# it under the terms of the GNU General Public License as published by
8+
# the Free Software Foundation, either version 3 of the license, or
9+
# (at your option) any later version.
10+
#
11+
# LumiSpy is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
# GNU General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU General Public License
17+
# along with LumiSpy. If not, see <https://www.gnu.org/licenses/#GPL>.
18+
19+
"""
20+
Lazy signal classes for cathodoluminescence spectral data
21+
---------------------------------------------------------
22+
"""
23+
24+
from hyperspy.docstrings.signal import LAZYSIGNAL_DOC
25+
from hyperspy.signals import LazySignal1D
26+
27+
from lumispy.signals import CLSpectrum, CLSEMSpectrum, CLSTEMSpectrum
28+
29+
30+
class LazyCLSpectrum(LazySignal1D, CLSpectrum):
31+
"""**General lazy 1D cathodoluminescence signal class.**"""
32+
33+
__doc__ += LAZYSIGNAL_DOC.replace("__BASECLASS__", "CLSpectrum")
34+
35+
36+
class LazyCLSEMSpectrum(LazySignal1D, CLSEMSpectrum):
37+
"""**Lazy 1D scanning electron microscopy cathodoluminescence signal class.**"""
38+
39+
__doc__ += LAZYSIGNAL_DOC.replace("__BASECLASS__", "CLSEMSpectrum")
40+
41+
42+
class LazyCLSTEMSpectrum(LazySignal1D, CLSTEMSpectrum):
43+
"""**Lazy 1D scanning transmission electron microscopy cathodoluminescence signal class.**"""
44+
45+
__doc__ += LAZYSIGNAL_DOC.replace("__BASECLASS__", "CLSTEMSpectrum")
46+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2019-2025 The LumiSpy developers
3+
#
4+
# This file is part of LumiSpy.
5+
#
6+
# LumiSpy is free software: you can redistribute it and/or modify
7+
# it under the terms of the GNU General Public License as published by
8+
# the Free Software Foundation, either version 3 of the license, or
9+
# (at your option) any later version.
10+
#
11+
# LumiSpy is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
# GNU General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU General Public License
17+
# along with LumiSpy. If not, see <https://www.gnu.org/licenses/#GPL>.
18+
19+
"""
20+
Lazy signal class for electroluminescence spectral data
21+
-------------------------------------------------------
22+
"""
23+
24+
from hyperspy.docstrings.signal import LAZYSIGNAL_DOC
25+
from hyperspy.signals import LazySignal1D
26+
27+
from lumispy.signals import ELSpectrum
28+
29+
30+
class LazyELSpectrum(LazySignal1D, ELSpectrum):
31+
"""**Lazy general 1D electroluminescence signal class**"""
32+
33+
__doc__ += LAZYSIGNAL_DOC.replace("__BASECLASS__", "ELSpectrum")
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2019-2025 The LumiSpy developers
3+
#
4+
# This file is part of LumiSpy.
5+
#
6+
# LumiSpy is free software: you can redistribute it and/or modify
7+
# it under the terms of the GNU General Public License as published by
8+
# the Free Software Foundation, either version 3 of the license, or
9+
# (at your option) any later version.
10+
#
11+
# LumiSpy is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
# GNU General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU General Public License
17+
# along with LumiSpy. If not, see <https://www.gnu.org/licenses/#GPL>.
18+
19+
"""
20+
Lazy Signal class for luminescence spectral data (1D).
21+
------------------------------------------------------
22+
"""
23+
24+
from hyperspy.docstrings.signal import LAZYSIGNAL_DOC
25+
from hyperspy.signals import LazySignal1D
26+
27+
from lumispy.signals import LumiSpectrum
28+
29+
30+
class LazyLumiSpectrum(LazySignal1D, LumiSpectrum):
31+
"""**General lazy 1D luminescence signal class.**"""
32+
33+
__doc__ += LAZYSIGNAL_DOC.replace("__BASECLASS__", "LumiSpectrum")
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2019-2025 The LumiSpy developers
3+
#
4+
# This file is part of LumiSpy.
5+
#
6+
# LumiSpy is free software: you can redistribute it and/or modify
7+
# it under the terms of the GNU General Public License as published by
8+
# the Free Software Foundation, either version 3 of the license, or
9+
# (at your option) any later version.
10+
#
11+
# LumiSpy is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
# GNU General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU General Public License
17+
# along with LumiSpy. If not, see <https://www.gnu.org/licenses/#GPL>.
18+
19+
"""
20+
Lazy signal class for luminescence transient data (1D)
21+
------------------------------------------------------
22+
"""
23+
24+
from hyperspy.docstrings.signal import LAZYSIGNAL_DOC
25+
from hyperspy.signals import LazySignal1D
26+
27+
from lumispy.signals import LumiTransient
28+
29+
30+
class LazyLumiTransient(LazySignal1D, LumiTransient):
31+
"""**General lazy 1D luminescence signal class (transient/time resolved)**"""
32+
33+
__doc__ += LAZYSIGNAL_DOC.replace("__BASECLASS__", "LumiTransient")
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2019-2025 The LumiSpy developers
3+
#
4+
# This file is part of LumiSpy.
5+
#
6+
# LumiSpy is free software: you can redistribute it and/or modify
7+
# it under the terms of the GNU General Public License as published by
8+
# the Free Software Foundation, either version 3 of the license, or
9+
# (at your option) any later version.
10+
#
11+
# LumiSpy is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
# GNU General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU General Public License
17+
# along with LumiSpy. If not, see <https://www.gnu.org/licenses/#GPL>.
18+
19+
"""
20+
Lazy signal class for luminescence transient data (2D)
21+
------------------------------------------------------
22+
"""
23+
24+
from hyperspy.docstrings.signal import LAZYSIGNAL_DOC
25+
from hyperspy.signals import LazySignal2D
26+
27+
from lumispy.signals import LumiTransientSpectrum
28+
29+
30+
class LazyLumiTransientSpectrum(LazySignal2D, LumiTransientSpectrum):
31+
"""**Lazy 2D luminescence signal class (spectral+transient/time resolved dimensions)**"""
32+
33+
__doc__ += LAZYSIGNAL_DOC.replace("__BASECLASS__", "LumiTransientSpectrum")
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2019-2025 The LumiSpy developers
3+
#
4+
# This file is part of LumiSpy.
5+
#
6+
# LumiSpy is free software: you can redistribute it and/or modify
7+
# it under the terms of the GNU General Public License as published by
8+
# the Free Software Foundation, either version 3 of the license, or
9+
# (at your option) any later version.
10+
#
11+
# LumiSpy is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
# GNU General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU General Public License
17+
# along with LumiSpy. If not, see <https://www.gnu.org/licenses/#GPL>.
18+
19+
"""
20+
Lazy signal class for photoluminescence spectral data
21+
-----------------------------------------------------
22+
"""
23+
24+
from hyperspy.docstrings.signal import LAZYSIGNAL_DOC
25+
from hyperspy.signals import LazySignal1D
26+
27+
from lumispy.signals import PLSpectrum
28+
29+
30+
class LazyPLSpectrum(LazySignal1D, PLSpectrum):
31+
"""**Lazy general 1D photoluminescence signal class**"""
32+
33+
__doc__ += LAZYSIGNAL_DOC.replace("__BASECLASS__", "PLSpectrum")

lumispy/signals/luminescence_spectrum.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
from warnings import warn
2626

2727
from hyperspy.signals import Signal1D
28-
from hyperspy._signals.lazy import LazySignal
2928
from traits.api import Undefined
3029

3130
from lumispy.signals.common_luminescence import CommonLumi
@@ -355,9 +354,3 @@ def centroid(self, signal_range=None, **kwargs):
355354
if center_of_mass.axes_manager.navigation_size > 0:
356355
center_of_mass = center_of_mass.transpose()
357356
return center_of_mass
358-
359-
360-
class LazyLumiSpectrum(LazySignal, LumiSpectrum):
361-
"""**General lazy 1D luminescence signal class.**"""
362-
363-
_lazy = True

0 commit comments

Comments
 (0)