Skip to content

Commit

Permalink
fix inconsistent docstring formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jlaehne committed Feb 17, 2022
1 parent 047d975 commit b212cb2
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 34 deletions.
16 changes: 13 additions & 3 deletions lumispy/signals/cl_spectrum.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# -**- coding: utf-8 -**-
# Copyright 2019-2022 The LumiSpy developers
#
# This file is part of LumiSpy.
Expand All @@ -16,7 +16,9 @@
# You should have received a copy of the GNU General Public License
# along with LumiSpy. If not, see <http://www.gnu.org/licenses/>.

"""Signal class for Cathodoluminescence spectral data.
"""
Signal class for cathodoluminescence spectral data
--------------------------------------------------
"""

from inspect import getfullargspec
Expand All @@ -30,7 +32,7 @@


class CLSpectrum(LumiSpectrum):
"""General 1D Cathodoluminescence signal class."""
"""**General 1D cathodoluminescence signal class.**"""

_signal_type = "CL"
_signal_dimension = 1
Expand Down Expand Up @@ -147,6 +149,8 @@ def remove_spikes(


class LazyCLSpectrum(LazySignal, CLSpectrum):
"""**General lazy 1D cathodoluminescence signal class.**"""

_lazy = True

pass
Expand All @@ -157,6 +161,8 @@ class LazyCLSpectrum(LazySignal, CLSpectrum):


class CLSEMSpectrum(CLSpectrum):
"""**1D scanning electron microscopy cathodoluminescence signal class.**"""

_signal_type = "CL_SEM"

def correct_grating_shift(
Expand Down Expand Up @@ -207,6 +213,8 @@ def correct_grating_shift(


class LazyCLSEMSpectrum(LazySignal, CLSEMSpectrum):
"""**Lazy 1D scanning electron microscopy cathodoluminescence signal class.**"""

_lazy = True

pass
Expand All @@ -217,13 +225,15 @@ class LazyCLSEMSpectrum(LazySignal, CLSEMSpectrum):


class CLSTEMSpectrum(CLSpectrum):
"""**1D scanning transmission electron microscopy cathodoluminescence signal class.**"""

_signal_type = "CL_STEM"

pass


class LazyCLSTEMSpectrum(LazySignal, CLSTEMSpectrum):
"""**Lazy 1D scanning transmission electron microscopy cathodoluminescence signal class.**"""

_lazy = True

Expand Down
8 changes: 6 additions & 2 deletions lumispy/signals/cl_transient.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
# You should have received a copy of the GNU General Public License
# along with LumiSpy. If not, see <http://www.gnu.org/licenses/>.

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

from hyperspy.signals import Signal2D
Expand All @@ -26,7 +28,7 @@


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

_signal_type = "TRCL"
_signal_dimension = 2
Expand All @@ -35,6 +37,8 @@ class CLTransient(LumiTransient):


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

_lazy = True

pass
6 changes: 4 additions & 2 deletions lumispy/signals/common_luminescence.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@
# You should have received a copy of the GNU General Public License
# along with LumiSpy. If not, see <http://www.gnu.org/licenses/>.

"""Signal class for Luminescence data (BaseSignal class).
"""
Signal class for luminescence data (BaseSignal class)
-----------------------------------------------------
"""

from numpy import isnan
from warnings import warn


class CommonLumi:
"""General Luminescence signal class (dimensionless)."""
"""**General luminescence signal class (dimensionless)**"""

def crop_edges(self, crop_px):
"""Crop the amount of pixels from the four edges of the scanning
Expand Down
10 changes: 6 additions & 4 deletions lumispy/signals/el_spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
# You should have received a copy of the GNU General Public License
# along with LumiSpy. If not, see <http://www.gnu.org/licenses/>.

"""Signal class for Electroluminescence spectral data.
"""
Signal class for electroluminescence spectral data
--------------------------------------------------
"""

from hyperspy._signals.lazy import LazySignal
Expand All @@ -25,9 +27,7 @@


class ELSpectrum(LumiSpectrum):
"""General 1D Electroluminescence signal class.
----------
"""
"""**General 1D electroluminescence signal class**"""

_signal_type = "EL"
_signal_dimension = 1
Expand All @@ -36,6 +36,8 @@ class ELSpectrum(LumiSpectrum):


class LazyELSpectrum(LazySignal, ELSpectrum):
"""**General lazy 1D electroluminescence signal class**"""

_lazy = True

pass
28 changes: 15 additions & 13 deletions lumispy/signals/luminescence_spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@


class LumiSpectrum(Signal1D, CommonLumi):
"""General 1D Luminescence signal class."""
"""**General 1D luminescence signal class.**"""

_signal_type = "Luminescence"
_signal_dimension = 1
Expand Down Expand Up @@ -128,8 +128,8 @@ def to_eV(self, inplace=True, jacobian=True):
>>> S1 = LumiSpectrum(np.ones(20), DataAxis(axis = np.arange(200,400,10)), ))
>>> S1.to_eV()
Note
----
Notes
-----
Using a non-linear axis works only for the RELEASE_next_minor development
branch of HyperSpy.
"""
Expand Down Expand Up @@ -289,8 +289,8 @@ def to_eV(self, inplace=True, jacobian=True):
>>> S1 = LumiSpectrum(np.ones(20), DataAxis(axis = np.arange(200,400,10)), ))
>>> S1.to_invcm()
Note
----
Notes
-----
Using a non-linear axis works only for the RELEASE_next_minor development
branch of HyperSpy.
"""
Expand Down Expand Up @@ -433,8 +433,8 @@ def to_invcm(self, inplace=True, jacobian=True):
>>> S1 = LumiSpectrum(np.ones(20), DataAxis(axis = np.arange(200,400,10)), ))
>>> S1.to_invcm(laser=325)
Note
----
Notes
-----
Using a non-linear axis works only for the RELEASE_next_minor development
branch of HyperSpy.
"""
Expand Down Expand Up @@ -517,8 +517,8 @@ def remove_background_from_file(self, background=None, inplace=False, **kwargs):
signal : LumiSpectrum
A background subtracted signal.
Note
----
Notes
-----
This function does not work with non-linear axes.
"""
if hasattr(self.metadata.Signal, "background_subtracted"):
Expand Down Expand Up @@ -619,8 +619,8 @@ def savetxt(
savetxt.__doc__ %= (SAVETXT_DOCSTRING, SAVETXT_PARAMETERS, SAVETXT_EXAMPLE)

TOARRAY_EXAMPLE = """
Note
----
Notes
-----
The output of this function can be used to convert a signal object to a
pandas dataframe, e.g. using `df = pd.Dataframe(S.to_array())`.
Expand Down Expand Up @@ -674,8 +674,8 @@ def px_to_nm_grating_solver(
the grating equation. See `lumispy.axes.solve_grating_equation` for
more details.
Parameters:
-----------
Parameters
----------
%s
inplace : bool
If False, it returns a new object with the transformation. If True,
Expand Down Expand Up @@ -718,6 +718,8 @@ def px_to_nm_grating_solver(


class LazyLumiSpectrum(LazySignal, LumiSpectrum):
"""**General lazy 1D luminescence signal class.**"""

_lazy = True

pass
8 changes: 6 additions & 2 deletions lumispy/signals/luminescence_transient.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
# You should have received a copy of the GNU General Public License
# along with LumiSpy. If not, see <http://www.gnu.org/licenses/>.

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

from hyperspy.signals import Signal2D
Expand All @@ -26,7 +28,7 @@


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

_signal_type = "Luminescence"
_signal_dimension = 2
Expand All @@ -35,6 +37,8 @@ class LumiTransient(Signal2D, CommonLumi):


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

_lazy = True

pass
9 changes: 5 additions & 4 deletions lumispy/signals/pl_spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
# You should have received a copy of the GNU General Public License
# along with LumiSpy. If not, see <http://www.gnu.org/licenses/>.

"""Signal class for Photoluminescence spectral data.
"""
Signal class for Photoluminescence spectral data
------------------------------------------------
"""

from hyperspy._signals.lazy import LazySignal
Expand All @@ -25,9 +27,7 @@


class PLSpectrum(LumiSpectrum):
"""General 1D Photoluminescence signal class.
----------
"""
"""**General 1D photoluminescence signal class**"""

_signal_type = "PL"
_signal_dimension = 1
Expand All @@ -36,6 +36,7 @@ class PLSpectrum(LumiSpectrum):


class LazyPLSpectrum(LazySignal, PLSpectrum):
"""**General lazy 1D photoluminescence signal class**"""

_lazy = True

Expand Down
8 changes: 6 additions & 2 deletions lumispy/signals/pl_transient.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
# You should have received a copy of the GNU General Public License
# along with LumiSpy. If not, see <http://www.gnu.org/licenses/>.

"""Signal class for Luminescence transient data (2D).
"""
Signal class for photoluminescence transient data (2D)
------------------------------------------------------
"""

from hyperspy.signals import Signal2D
Expand All @@ -26,7 +28,7 @@


class PLTransient(LumiTransient):
"""PL 2D luminescence signal class (transient/time resolved)."""
"""**General 2D photoluminescence signal class (transient/time resolved)**"""

_signal_type = "TRPL"
_signal_dimension = 2
Expand All @@ -35,6 +37,8 @@ class PLTransient(LumiTransient):


class LazyPLTransient(LazySignal, PLTransient):
"""**General lazy 2D photoluminescence signal class (transient/time resolved)**"""

_lazy = True

pass
4 changes: 2 additions & 2 deletions lumispy/utils/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@
`header`, `footer`, `comments`, or `encoding`."""

TOARRAY_EXAMPLE = """
Note
--------
Notes
-----
The output of this function can be used to convert a signal object to a
pandas dataframe, e.g. using `df = pd.Dataframe(lum.to_array(S))`.
Expand Down

0 comments on commit b212cb2

Please sign in to comment.