Skip to content

Commit

Permalink
Merge pull request #59 from ericpre/extend_public_API
Browse files Browse the repository at this point in the history
Extend public API and fix documentation
  • Loading branch information
ericpre authored Aug 20, 2024
2 parents 3b7425e + 9e0d0be commit 75ca046
Show file tree
Hide file tree
Showing 65 changed files with 7,483 additions and 6,996 deletions.
24 changes: 11 additions & 13 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,14 @@
# import sys
# sys.path.insert(0, os.path.abspath('.'))

import hyperspy.api as hs
import numpydoc
from packaging.version import Version


# Set logging level to `ERROR` to avoid exspy warning in documentation
hs.set_log_level("ERROR")


# -- Project information -----------------------------------------------------

project = "eXSpy"
copyright = "2023, eSpy Developers"
copyright = "2024, eXSpy Developers"
author = "eXSpy Developers"


Expand All @@ -44,6 +39,7 @@
"sphinx_copybutton",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.doctest",
"sphinx.ext.githubpages",
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
Expand All @@ -54,17 +50,13 @@
linkcheck_ignore = [
"https://doi.org/10.1021/acs.nanolett.5b00449", # 403 Client Error: Forbidden for url
"https://onlinelibrary.wiley.com/doi/10.1111/j.1365-2818.2006.01549.x", # 403 Client Error: Forbidden for url
# Remove when setup
"https://github.com/hyperspy/exspy-demos",
"https://www.anaconda.com/blog/understanding-conda-and-pip", # Transcient?
# Remove once it is merged and the links are working
"https://exspy.readthedocs.io",
"https://github.com/hyperspy/exspy/blob/main/releasing_guide.md",
"https://onlinelibrary.wiley.com/doi/10.1002/sia.5789", # 403 Client Error: Forbidden for url
"https://onlinelibrary.wiley.com/doi/10.1002/jemt.20597", # 403 Client Error: Forbidden for url
]

intersphinx_mapping = {
"dask": ("https://docs.dask.org/en/latest", None),
"hyperspy": ("https://hyperspy.org/hyperspy-doc/dev", None),
"hyperspy": ("https://hyperspy.org/hyperspy-doc/current", None),
"kikuchipy": ("https://kikuchipy.org/en/latest/", None),
"matplotlib": ("https://matplotlib.org/stable", None),
"numpy": ("https://numpy.org/doc/stable", None),
Expand Down Expand Up @@ -159,3 +151,9 @@
towncrier_draft_autoversion_mode = "draft"
towncrier_draft_include_empty = False
towncrier_draft_working_directory = ".."

doctest_global_setup = """
import hyperspy.api as hs
import exspy
import numpy as np
"""
2 changes: 2 additions & 0 deletions doc/reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ Reference
material
models
signals
utils.eds
utils.eels
52 changes: 50 additions & 2 deletions doc/reference/material.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,58 @@
.. autosummary::

atomic_to_weight
weight_to_atomic
density_of_mixture
elements
mass_absorption_coefficient
mass_absorption_mixture
weight_to_atomic

.. automodule:: exspy.material
:members:
:members:

.. autoattribute:: exspy.material.elements
:annotation:

Database of element properties. The following properties are included:

.. code::
├── Atomic_properties
│ ├── Binding_energies
│ └── Xray_lines
├── General_properties
│ ├── Z
│ ├── atomic_weight
│ └── name
└── Physical_properties
└── density_gcm3
Examples:

.. code::
>>> exspy.material.elements.Fe.General_properties
├── Z = 26
├── atomic_weight = 55.845
└── name = iron
>>> exspy.material.elements.Fe.Physical_properties
└── density (g/cm^3) = 7.874
>>> exspy.material.elements.Fe.Atomic_properties.Xray_lines
├── Ka
│ ├── energy (keV) = 6.404
│ └── weight = 1.0
├── Kb
│ ├── energy (keV) = 7.0568
│ └── weight = 0.1272
├── La
│ ├── energy (keV) = 0.705
│ └── weight = 1.0
├── Lb3
│ ├── energy (keV) = 0.792
│ └── weight = 0.02448
├── Ll
│ ├── energy (keV) = 0.615
│ └── weight = 0.3086
└── Ln
├── energy (keV) = 0.62799
└── weight = 0.12525
17 changes: 17 additions & 0 deletions doc/reference/utils.eds.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
:mod:`exspy.utils.eds`
----------------------

.. currentmodule:: exspy.utils.eds


.. autosummary::
cross_section_to_zeta
electron_range
get_xray_lines_near_energy
take_off_angle
xray_range
zeta_to_cross_section


.. automodule:: exspy.utils.eds
:members:
17 changes: 17 additions & 0 deletions doc/reference/utils.eels.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
:mod:`exspy.utils.eels`
-----------------------

.. currentmodule:: exspy.utils.eels


.. autosummary::
effective_angle
get_edges_near_energy
get_info_from_edges
iMFP_angular_correction
iMFP_Iakoubovskii
iMFP_TPP2M


.. automodule:: exspy.utils.eels
:members:
Loading

0 comments on commit 75ca046

Please sign in to comment.