Skip to content

Commit

Permalink
Enable checking docstring links
Browse files Browse the repository at this point in the history
  • Loading branch information
ericpre committed Mar 31, 2024
1 parent 95d7aec commit f06d8ff
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 25 deletions.
12 changes: 9 additions & 3 deletions doc/api/signals.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
:mod:`holospy.signals.hologram_image`
-------------------------------------
:mod:`holospy.signals`
----------------------

.. automodule:: holospy.signals.hologram_image
.. currentmodule:: holospy.signals

.. autosummary::
HologramImage
LazyHologramImage

.. automodule:: holospy.signals
:members:
2 changes: 1 addition & 1 deletion doc/api/tools.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
:mod:`holospy.tools`
--------------------------
--------------------

.. automodule:: holospy.tools
:members:
12 changes: 7 additions & 5 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,20 @@
]

# Check links to API when building documentation
nitpicky = False
# Remove when fixed in hyperspy
nitpick_ignore_regex = [(r"py:.*", r"hyperspy.api.*")]
nitpicky = True

# -- Options for numpydoc extension -----------------------------------

numpydoc_show_class_members = False
numpydoc_xref_param_type = True
numpydoc_xref_ignore = {"type", "optional", "default", "of"}

if Version(numpydoc.__version__) >= Version("1.6.0rc0"):
numpydoc_validation_checks = {"all", "ES01", "EX01", "GL02", "GL03", "SA01", "SS06"}
autoclass_content = "both"

autodoc_default_options = {
"show-inheritance": True,
}
toc_object_entries_show_parents = "hide"

# -- Options for towncrier_draft extension -----------------------------------

Expand Down
30 changes: 15 additions & 15 deletions doc/user_guide/electron_holography.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ Electron Holography
HoloSpy provides the user with a signal class which can be used to process
(off-axis) electron holography data:

* :py:class:`~.signals.hologram_image.HologramImage`
* :py:class:`~.signals.HologramImage`

It inherits from :external+hyperspy:py:class:`hyperspy._signals.signal2d.Signal2D` class and thus can
It inherits from :external+hyperspy:py:class:`hyperspy.api.signals.Signal2D` class and thus can
use all of its functionality. The usage of the class is explained in the
following sections.

To transform a :external+hyperspy:py:class:`hyperspy._signals.signal2d.Signal2D` (or subclass) into a
:py:class:`~.signals.hologram_image.HologramImage` use:
To transform a :external+hyperspy:py:class:`hyperspy.api.signals.Signal2D` (or subclass) into a
:py:class:`~.signals.HologramImage` use:

.. code-block:: python
Expand All @@ -30,10 +30,10 @@ and :ref:`[Joy1993] <Joy1993>`.
Fourier based reconstruction of off-axis holograms (includes
finding a side band in FFT, isolating and filtering it, recenter and
calculate inverse Fourier transform) can be performed using the
:py:meth:`~.signals.hologram_image.HologramImage.reconstruct_phase` method
which returns a :external+hyperspy:py:class:`hyperspy._signals.complex_signal2d.ComplexSignal2D` class,
:py:meth:`~.signals.HologramImage.reconstruct_phase` method
which returns a :external+hyperspy:py:class:`hyperspy.api.signals.ComplexSignal2D` class,
containing the reconstructed electron wave.
The :py:meth:`~.signals.hologram_image.HologramImage.reconstruct_phase` method
The :py:meth:`~.signals.HologramImage.reconstruct_phase` method
takes sideband position and size as parameters:

.. code-block:: python
Expand All @@ -51,10 +51,10 @@ The parameters can be found automatically by calling following methods:
... sb='lower')
>>> sb_size = im.estimate_sideband_size(sb_position)
:py:meth:`~.signals.hologram_image.HologramImage.estimate_sideband_position`
:py:meth:`~.signals.HologramImage.estimate_sideband_position`
method searches for maximum of intensity in upper or lower part of FFT pattern
(parameter ``sb``) excluding the middle area defined by ``ap_cb_radius``.
:py:meth:`~._signals.hologram_image.HologramImage.estimate_sideband_size` method
:py:meth:`~.signals.HologramImage.estimate_sideband_size` method
calculates the radius of the sideband filter as half of the distance to the
central band which is commonly used for strong phase objects. Alternatively,
the sideband filter radius can be recalculate as 1/3 of the distance
Expand Down Expand Up @@ -105,7 +105,7 @@ than pixels (by default) by setting ``sb_unit`` value either to ``mrad`` or
... sb_position=sb_position, sb_size=30,
... sb_smoothness=0.05*30,sb_unit='mrad')
Also the :py:meth:`~.signals.hologram_image.HologramImage.reconstruct_phase`
Also the :py:meth:`~.signals.HologramImage.reconstruct_phase`
method can output wave images with desired size (shape). By default the shape
of the original hologram is preserved. Though this leads to oversampling of the
output wave images, since the information is limited by the size of the
Expand All @@ -121,11 +121,11 @@ diameter of the sideband as follows:
... output_shape=(out_size, out_size))
Note that the
:py:meth:`~.signals.hologram_image.HologramImage.reconstruct_phase`
:py:meth:`~.signals.HologramImage.reconstruct_phase`
method can be called without parameters, which will cause their automatic
assignment by
:py:meth:`~.signals.hologram_image.HologramImage.estimate_sideband_position`
and :py:meth:`~.signals.hologram_image.HologramImage.estimate_sideband_size`
:py:meth:`~.signals.HologramImage.estimate_sideband_position`
and :py:meth:`~.signals.HologramImage.estimate_sideband_size`
methods. This, however, is not recommended for not experienced users.

.. _holography.stats-label:
Expand All @@ -151,7 +151,7 @@ calculated and displayed as follows:
Getting hologram statistics
---------------------------
There are many reasons to have an access to some parameters of holograms which describe the quality of the data.
:meth:`~.signals.hologram_image.HologramImage.statistics` can be used to calculate carrier frequency,
:meth:`~.signals.HologramImage.statistics` can be used to calculate carrier frequency,
fringe spacing and estimate fringe contrast. The method outputs dictionary with the values listed above calculated also
in different units. In particular fringe spacing is calculated in pixels (fringe sampling) as well as in
calibrated units. Carrier frequency is calculated in inverse pixels or calibrated units as well as radians.
Expand Down Expand Up @@ -186,4 +186,4 @@ By default ``apodization`` parameter is set to ``hanning`` which applies Hanning
especially with extreme sampling of fringes and strong contrast variation due to Fresnel effects
the calculated fringe contrast provides only an estimate and the values may differ strongly depending on apodization.

For further information see documentation of :meth:`~.signals.hologram_image.HologramImage.statistics`.
For further information see documentation of :meth:`~.signals.HologramImage.statistics`.
10 changes: 9 additions & 1 deletion holospy/signals/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@
# You should have received a copy of the GNU General Public License
# along with holospy. If not, see <http://www.gnu.org/licenses/>.

"""Signals to be operated on. The basic unit of data"""
"""
Modules containing the HoloSpy signals and their lazy counterparts.
HologramImage
For holography data
LazyHologramImage
For holography data processed lazily
"""

from .hologram_image import HologramImage, LazyHologramImage

Expand Down

0 comments on commit f06d8ff

Please sign in to comment.