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

reorganize transient classes #118

Merged
merged 6 commits into from
Apr 27, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Added

Changed
-------
- Make `LumiTransient` and subclasses 1D and add 2D `LumiTransientSpectrum` classes
- Add python 3.10 build. Remove python 3.6.
- Fix error in background dimensions that allows compatibility for updated `map` in HyperSpy (failing integration tests)
- Fix for links in PyPi
Expand Down
68 changes: 39 additions & 29 deletions doc/source/user_guide/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,43 +85,53 @@ signal types (or inheriting) signal types.

.. table:: LumiSpy subclasses and their basic attributes.

+--------------------------------------------------------------+------------------+---------------+---------+-----------------------------------------------------------+
| BaseSignal subclass | signal_dimension | signal_type | dtype | aliases |
+==============================================================+==================+===============+=========+===========================================================+
| :py:class:`~.signals.luminescence_spectrum.LumiSpectrum` | 1 | Luminescence | real | LuminescenceSpectrum |
+--------------------------------------------------------------+------------------+---------------+---------+-----------------------------------------------------------+
| :py:class:`~.signals.cl_spectrum.CLSpectrum` | 1 | CL | real | CLSpectrum, cathodoluminescence |
+--------------------------------------------------------------+------------------+---------------+---------+-----------------------------------------------------------+
| :py:class:`~.signals.cl_spectrum.CLSEMSpectrum` | 1 | CL_SEM | real | CLSEM, cathodoluminescence SEM |
+--------------------------------------------------------------+------------------+---------------+---------+-----------------------------------------------------------+
| :py:class:`~.signals.cl_spectrum.CLSTEMSpectrum` | 1 | CL_STEM | real | CLSTEM, cathodoluminescence STEM |
+--------------------------------------------------------------+------------------+---------------+---------+-----------------------------------------------------------+
| :py:class:`~.signals.el_spectrum.ELSpectrum` | 1 | EL | real | ELSpectrum, electroluminescence |
+--------------------------------------------------------------+------------------+---------------+---------+-----------------------------------------------------------+
| :py:class:`~.signals.pl_spectrum.PLSpectrum` | 1 | PL | real | PLSpectrum, photoluminescence |
+--------------------------------------------------------------+------------------+---------------+---------+-----------------------------------------------------------+
| :py:class:`~.signals.luminescence_transient.LumiTransient` | 2 | Luminescence | real | TRLumi, TR luminescence, time-resolved luminescence |
+--------------------------------------------------------------+------------------+---------------+---------+-----------------------------------------------------------+
| :py:class:`~.signals.cl_transient.CLTransient` | 2 | TRCL | real | TR cathodoluminescence, time-resolved cathodoluminescence |
+--------------------------------------------------------------+------------------+---------------+---------+-----------------------------------------------------------+
| :py:class:`~.signals.pl_transient.PLTransient` | 2 | TRPL | real | TR photoluminescence, time-resolved photoluminescence |
+--------------------------------------------------------------+------------------+---------------+---------+-----------------------------------------------------------+
+-----------------------------------------------------------------+------------------+---------------+---------+-----------------------------------------------------------------------------+
| BaseSignal subclass | signal_dimension | signal_type | dtype | aliases |
+=================================================================+==================+===============+=========+=============================================================================+
| :py:class:`~.signals.luminescence_spectrum.LumiSpectrum` | 1 | Luminescence | real | LuminescenceSpectrum |
+-----------------------------------------------------------------+------------------+---------------+---------+-----------------------------------------------------------------------------+
| :py:class:`~.signals.cl_spectrum.CLSpectrum` | 1 | CL | real | CLSpectrum, cathodoluminescence |
+-----------------------------------------------------------------+------------------+---------------+---------+-----------------------------------------------------------------------------+
| :py:class:`~.signals.cl_spectrum.CLSEMSpectrum` | 1 | CL_SEM | real | CLSEM, cathodoluminescence SEM |
+-----------------------------------------------------------------+------------------+---------------+---------+-----------------------------------------------------------------------------+
| :py:class:`~.signals.cl_spectrum.CLSTEMSpectrum` | 1 | CL_STEM | real | CLSTEM, cathodoluminescence STEM |
+-----------------------------------------------------------------+------------------+---------------+---------+-----------------------------------------------------------------------------+
| :py:class:`~.signals.el_spectrum.ELSpectrum` | 1 | EL | real | ELSpectrum, electroluminescence |
+-----------------------------------------------------------------+------------------+---------------+---------+-----------------------------------------------------------------------------+
| :py:class:`~.signals.pl_spectrum.PLSpectrum` | 1 | PL | real | PLSpectrum, photoluminescence |
+-----------------------------------------------------------------+------------------+---------------+---------+-----------------------------------------------------------------------------+
| :py:class:`~.signals.luminescence_transient.LumiTransient` | 1 | Transient | real | TRLumi, TR luminescence, time-resolved luminescence |
+-----------------------------------------------------------------+------------------+---------------+---------+-----------------------------------------------------------------------------+
| :py:class:`~.signals.cl_transient.CLTransient` | 1 | TRCL | real | TR cathodoluminescence, time-resolved cathodoluminescence |
+-----------------------------------------------------------------+------------------+---------------+---------+-----------------------------------------------------------------------------+
| :py:class:`~.signals.pl_transient.PLTransient` | 1 | TRPL | real | TR photoluminescence, time-resolved photoluminescence |
+-----------------------------------------------------------------+------------------+---------------+---------+-----------------------------------------------------------------------------+
| :py:class:`~.signals.luminescence_transientspec.LumiTransient` | 2 | TransientSpec | real | TRLumiSpec, TR luminescence spectrum, time-resolved luminescence spectrum |
+-----------------------------------------------------------------+------------------+---------------+---------+-----------------------------------------------------------------------------+
| :py:class:`~.signals.cl_transientspec.CLTransientSpectrum` | 2 | TRCLSpec | real | TR cathodoluminescence spectrum, time-resolved cathodoluminescence spectrum |
+-----------------------------------------------------------------+------------------+---------------+---------+-----------------------------------------------------------------------------+
| :py:class:`~.signals.pl_transientspec.PLTransientSpectrum` | 2 | TRPLSpec | real | TR photoluminescence, time-resolved photoluminescence spectrum |
+-----------------------------------------------------------------+------------------+---------------+---------+-----------------------------------------------------------------------------+


The hierarchy of the LumiSpy signal types and their inheritance from HyperSpy
is summarized in the following diagram:

| └── :external:py:class:`hyperspy.signal.BaseSignal`
| ├── :external:py:class:`hyperspy._signals.signal1d.Signal1D`
| │ └── :py:class:`~.signals.luminescence_spectrum.LumiSpectrum`
| │ ├── :py:class:`~.signals.cl_spectrum.CLSpectrum`
| │ │ ├── :py:class:`~.signals.cl_spectrum.CLSEMSpectrum`
| │ │ └── :py:class:`~.signals.cl_spectrum.CLSTEMSpectrum`
| │ ├── :py:class:`~.signals.cl_spectrum.ELSpectrum`
| │ └── :py:class:`~.signals.cl_spectrum.PLSpectrum`
| │ │ ├── :py:class:`~.signals.cl_spectrum.CLSpectrum`
| │ │ │ ├── :py:class:`~.signals.cl_spectrum.CLSEMSpectrum`
| │ │ │ └── :py:class:`~.signals.cl_spectrum.CLSTEMSpectrum`
| │ │ ├── :py:class:`~.signals.el_spectrum.ELSpectrum`
| │ │ └── :py:class:`~.signals.pl_spectrum.PLSpectrum`
| │ └── :py:class:`~.signals.luminescence_transient.LumiTransient`
| │ ├── :py:class:`~.signals.cl_transient.CLTransient`
| │ └── :py:class:`~.signals.pl_transient.PLTransient`
| └── :py:class:`hyperspy.signal.Signal2D`
| └── :py:class:`~.signals.luminescence_transient.LumiTransient`
| ├── :py:class:`~.signals.cl_transient.CLTransient`
| └── :py:class:`~.signals.cl_transient.PLTransient`
| └── :py:class:`~.signals.luminescence_transientspec.LumiTransientSpectrum`
| ├── :py:class:`~.signals.cl_transientspec.CLTransientSpectrum`
| └── :py:class:`~.signals.pl_transientspec.PLTransientSpectrum`
|
|

Expand Down
75 changes: 67 additions & 8 deletions lumispy/hyperspy_extension.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,22 +130,22 @@ signals:
module: lumispy.signals.cl_spectrum

LumiTransient:
signal_type: Luminescence
signal_type: Transient
signal_type_aliases:
- TRLumi
- TR luminescence
- time-resolved luminescence
signal_dimension: 2
signal_dimension: 1
dtype: real
lazy: False
module: lumispy.signals.luminescence_transient
LazyLumiTransient:
signal_type: Luminescence
signal_type: Transient
signal_type_aliases:
- TRLumi
- TR luminescence
- time-resolved luminescence
signal_dimension: 2
signal_dimension: 1
dtype: real
lazy: True
module: lumispy.signals.luminescence_transient
Expand All @@ -155,7 +155,7 @@ signals:
signal_type_aliases:
- TR cathodoluminescence
- time-resolved cathodoluminescence
signal_dimension: 2
signal_dimension: 1
dtype: real
lazy: False
module: lumispy.signals.cl_transient
Expand All @@ -164,7 +164,7 @@ signals:
signal_type_aliases:
- TR cathodoluminescence
- time-resolved cathodoluminescence
signal_dimension: 2
signal_dimension: 1
dtype: real
lazy: True
module: lumispy.signals.cl_transient
Expand All @@ -174,7 +174,7 @@ signals:
signal_type_aliases:
- TR photoluminescence
- time-resolved photoluminescence
signal_dimension: 2
signal_dimension: 1
dtype: real
lazy: False
module: lumispy.signals.pl_transient
Expand All @@ -183,7 +183,66 @@ signals:
signal_type_aliases:
- TR photoluminescence
- time-resolved photoluminescence
signal_dimension: 2
signal_dimension: 1
dtype: real
lazy: True
module: lumispy.signals.pl_transient

LumiTransientSpectrum:
signal_type: TransientSpec
signal_type_aliases:
- TRLumiSpec
- TR luminescence spectrum
- time-resolved luminescence spectrum
signal_dimension: 2
dtype: real
lazy: False
module: lumispy.signals.luminescence_transientspec
LazyLumiTransientSpectrum:
signal_type: TransientSpec
signal_type_aliases:
- TRLumiSpec
- TR luminescence spectrum
- time-resolved luminescence spectrum
signal_dimension: 2
dtype: real
lazy: True
module: lumispy.signals.luminescence_transientspec

CLTransientSpectrum:
signal_type: TRCLSpec
signal_type_aliases:
- TR cathodoluminescence spectrum
- time-resolved cathodoluminescence spectrum
signal_dimension: 2
dtype: real
lazy: False
module: lumispy.signals.cl_transientspec
LazyCLTransientSpectrum:
signal_type: TRCLSpec
signal_type_aliases:
- TR cathodoluminescence spectrum
- time-resolved cathodoluminescence spectrum
signal_dimension: 2
dtype: real
lazy: True
module: lumispy.signals.cl_transientspec

PLTransientSpectrum:
signal_type: TRPLSpec
signal_type_aliases:
- TR photoluminescence spectrum
- time-resolved photoluminescence spectrum
signal_dimension: 2
dtype: real
lazy: False
module: lumispy.signals.pl_transientspec
LazyPLTransientSpectrum:
signal_type: TRPLSpec
signal_type_aliases:
- TR photoluminescence spectrum
- time-resolved photoluminescence spectrum
signal_dimension: 2
dtype: real
lazy: True
module: lumispy.signals.pl_transientspec
9 changes: 9 additions & 0 deletions lumispy/signals/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
from .luminescence_transient import LumiTransient, LazyLumiTransient
from .cl_transient import CLTransient, LazyCLTransient
from .pl_transient import PLTransient, LazyPLTransient
from .luminescence_transientspec import LumiTransientSpectrum, LazyLumiTransientSpectrum
from .cl_transientspec import CLTransientSpectrum, LazyCLTransientSpectrum
from .pl_transientspec import PLTransientSpectrum, LazyPLTransientSpectrum


__all__ = [
Expand All @@ -46,4 +49,10 @@
"LazyCLTransient",
"PLTransient",
"LazyPLTransient",
"LumiTransientSpectrum",
"LazyLumiTransientSpectrum",
"CLTransientSpectrum",
"LazyCLTransientSpectrum",
"PLTransientSpectrum",
"LazyPLTransientSpectrum",
]
9 changes: 4 additions & 5 deletions lumispy/signals/cl_transient.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,26 @@
# along with LumiSpy. If not, see <https://www.gnu.org/licenses/#GPL>.

"""
Signal class for cathodoluminescence transient data (2D)
Signal class for cathodoluminescence transient data (1D)
--------------------------------------------------------
"""

from hyperspy.signals import Signal2D
from hyperspy._signals.lazy import LazySignal

from lumispy.signals.luminescence_transient import LumiTransient


class CLTransient(LumiTransient):
"""**General 2D cathodoluminescence signal class (transient/time resolved)**"""
"""**General 1D cathodoluminescence signal class (transient/time resolved)**"""

_signal_type = "TRCL"
_signal_dimension = 2
_signal_dimension = 1

pass


class LazyCLTransient(LazySignal, CLTransient):
"""**General lazy 2D cathodoluminescence signal class (transient/time resolved)**"""
"""**General lazy 1D cathodoluminescence signal class (transient/time resolved)**"""

_lazy = True

Expand Down
43 changes: 43 additions & 0 deletions lumispy/signals/cl_transientspec.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# -*- coding: utf-8 -*-
# Copyright 2019-2022 The LumiSpy developers
#
# This file is part of LumiSpy.
#
# LumiSpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the license, or
# (at your option) any later version.
#
# LumiSpy is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LumiSpy. If not, see <https://www.gnu.org/licenses/#GPL>.

"""
Signal class for cathodoluminescence transient data (2D)
--------------------------------------------------------
"""

from hyperspy._signals.lazy import LazySignal

from lumispy.signals.luminescence_transientspec import LumiTransientSpectrum


class CLTransientSpectrum(LumiTransientSpectrum):
"""**General 2D cathodoluminescence signal class (transient/time resolved)**"""

_signal_type = "TRCLSpec"
_signal_dimension = 2

pass


class LazyCLTransientSpectrum(LazySignal, CLTransientSpectrum):
"""**General lazy 2D cathodoluminescence signal class (transient/time resolved)**"""

_lazy = True

pass
31 changes: 31 additions & 0 deletions lumispy/signals/common_transient.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
# Copyright 2019-2022 The LumiSpy developers
#
# This file is part of LumiSpy.
#
# LumiSpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the license, or
# (at your option) any later version.
#
# LumiSpy is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LumiSpy. If not, see <https://www.gnu.org/licenses/#GPL>.

"""
Signal class for transient data (BaseSignal class)
--------------------------------------------------
"""

from numpy import isnan
from warnings import warn


class CommonTransient:
"""**General transient signal class (dimensionless)**"""

pass
16 changes: 8 additions & 8 deletions lumispy/signals/luminescence_transient.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,27 @@
# along with LumiSpy. If not, see <https://www.gnu.org/licenses/#GPL>.

"""
Signal class for luminescence transient data (2D)
Signal class for luminescence transient data (1D)
-------------------------------------------------
"""

from hyperspy.signals import Signal2D
from hyperspy.signals import Signal1D
from hyperspy._signals.lazy import LazySignal

from lumispy.signals.common_luminescence import CommonLumi
from lumispy.signals.common_transient import CommonTransient


class LumiTransient(Signal2D, CommonLumi):
"""**General 2D luminescence signal class (transient/time resolved)**"""
class LumiTransient(Signal1D, CommonTransient):
"""**General 1D luminescence signal class (transient/time resolved)**"""

_signal_type = "Luminescence"
_signal_dimension = 2
_signal_type = "Transient"
_signal_dimension = 1

pass


class LazyLumiTransient(LazySignal, LumiTransient):
"""**General lazy 2D luminescence signal class (transient/time resolved)**"""
"""**General lazy 1D luminescence signal class (transient/time resolved)**"""

_lazy = True

Expand Down
Loading