From 8c6d02b29f47bd2c149f7a3619c97431314579c3 Mon Sep 17 00:00:00 2001 From: Eric Prestat Date: Tue, 11 Jun 2024 11:56:34 +0100 Subject: [PATCH 1/5] Fix `EELSArctan` gradients --- exspy/components/eels_arctan.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exspy/components/eels_arctan.py b/exspy/components/eels_arctan.py index 5a52432bf..4faab579e 100644 --- a/exspy/components/eels_arctan.py +++ b/exspy/components/eels_arctan.py @@ -51,12 +51,12 @@ class EELSArctan(hs.model.components1D.Expression): """ - def __init__(self, A=1.0, k=1.0, x0=1.0, module=["numpy", "scipy"], **kwargs): + def __init__(self, A=1.0, k=1.0, x0=1.0, module=["numpy"], **kwargs): # To be able to still read old file versions that contain this argument if "minimum_at_zero" in kwargs: del kwargs["minimum_at_zero"] super().__init__( - expression="A * (pi /2 + arctan(k * (x - x0)))", + expression="A * (pi /2 + atan(k * (x - x0)))", name="EELSArctan", A=A, k=k, From 04475737f6ee2e1f1e15093c9307f4d393541d9b Mon Sep 17 00:00:00 2001 From: Eric Prestat Date: Tue, 11 Jun 2024 12:07:58 +0100 Subject: [PATCH 2/5] Update links to EDS tutorials since it has moved to exspy-demos --- doc/user_guide/eds.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/user_guide/eds.rst b/doc/user_guide/eds.rst index eee7ce488..6bf2b64c7 100644 --- a/doc/user_guide/eds.rst +++ b/doc/user_guide/eds.rst @@ -12,7 +12,7 @@ This chapter describes step-by-step the analysis of an EDS spectrum (SEM or TEM). .. NOTE:: - See also the `EDS tutorials `_. + See also the `EDS tutorials `_. Spectrum loading and parameters ------------------------------- From c4ba1910a84772d7221c85ef67f5a78ed9d145f6 Mon Sep 17 00:00:00 2001 From: Eric Prestat Date: Tue, 11 Jun 2024 13:14:31 +0100 Subject: [PATCH 3/5] Fix API reference of `EELSCLEdge` and `PESCoreLineShape` components --- exspy/components/eels_cl_edge.py | 21 +++++++++------------ exspy/components/pes_core_line_shape.py | 5 ++++- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/exspy/components/eels_cl_edge.py b/exspy/components/eels_cl_edge.py index 0a2b91854..8bbc7d69c 100644 --- a/exspy/components/eels_cl_edge.py +++ b/exspy/components/eels_cl_edge.py @@ -75,7 +75,7 @@ class EELSCLEdge(Component): The preferred option is to use a database of cross sections in GOSH format. One such database can be freely downloaded from Zenodo at: - https://zenodo.org/record/6599071 while information on the GOSH format + https://doi.org/%s while information on the GOSH format are available at: https://gitlab.com/gguzzina/gosh . eXSpy also supports Peter Rez's Hartree Slater cross sections @@ -83,8 +83,8 @@ class EELSCLEdge(Component): software. If Digital Micrograph is installed in the system eXSpy in the standard location eXSpy should find the path to the HS GOS folder. Otherwise, the location of the folder can be defined in eXSpy - preferences, which can be done through ~:func:`~.api.preferences.gui` or - the :attr:`~api.preferences.EELS.eels_gos_files_path` variable. + preferences, which can be done through :func:`hyperspy.api.preferences.gui` or + the :attr:`hyperspy.api.preferences.EELS.eels_gos_files_path` variable. Parameters ---------- @@ -96,8 +96,8 @@ class EELSCLEdge(Component): The GOS to use. Default is ``'gosh'``. If str, it must the path to gosh GOS file. gos_file_path : str, None - Only with GOS='gosh'. Specify the file path of the gosh file - to use. If None, use the file from doi:{} + Only with ``GOS='gosh'``. Specify the file path of the gosh file + to use. If None, use the file from https://doi.org/%s Attributes ---------- @@ -140,7 +140,7 @@ class EELSCLEdge(Component): fine_structure_components : set, default ``set()`` A set containing components to model the fine structure region of the EELS ionization edge. - """.format(_GOSH_DOI) + """ _fine_structure_smoothing = 0.3 _fine_structure_coeff_free = True @@ -290,12 +290,6 @@ def _set_active_fine_structure_components(self, active, **kwargs): @property def fine_structure_smoothing(self): - """Controls the level of the smoothing of the fine structure. - - It must a real number between 0 and 1. The higher close to 0 - the higher the smoothing. - - """ return self._fine_structure_smoothing @fine_structure_smoothing.setter @@ -539,3 +533,6 @@ def as_dictionary(self, fullcopy=True): ] dic["_whitelist"]["fine_structure_components"] = "" return dic + + +EELSCLEdge.__doc__ %= (_GOSH_DOI, _GOSH_DOI) diff --git a/exspy/components/pes_core_line_shape.py b/exspy/components/pes_core_line_shape.py index e0484c42d..4480b33c3 100644 --- a/exspy/components/pes_core_line_shape.py +++ b/exspy/components/pes_core_line_shape.py @@ -32,7 +32,10 @@ def _calculate_shirley_background(values): class PESCoreLineShape(Component): - """ """ + """ + Gaussian component with a Shirley background for photoemission + spectroscopy analysis. + """ def __init__(self, A=1.0, FWHM=1.0, origin=0.0, ab=0.0, shirley=0.0): Component.__init__(self, ["A", "FWHM", "origin", "ab", "shirley"]) From 24560abae2ca969575d0781a068517405a726d3c Mon Sep 17 00:00:00 2001 From: Eric Prestat Date: Mon, 24 Jun 2024 09:35:12 +0100 Subject: [PATCH 4/5] Improve docstring MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jonas Lähnemann --- exspy/components/eels_cl_edge.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exspy/components/eels_cl_edge.py b/exspy/components/eels_cl_edge.py index 8bbc7d69c..3a2f9d8dd 100644 --- a/exspy/components/eels_cl_edge.py +++ b/exspy/components/eels_cl_edge.py @@ -80,9 +80,9 @@ class EELSCLEdge(Component): eXSpy also supports Peter Rez's Hartree Slater cross sections parametrised as distributed by Gatan in their Digital Micrograph (DM) - software. If Digital Micrograph is installed in the system eXSpy in the - standard location eXSpy should find the path to the HS GOS folder. - Otherwise, the location of the folder can be defined in eXSpy + software. If Digital Micrograph is installed in the system in the + standard location, eXSpy should find the path to the HS GOS folder. + Otherwise, the location of the folder can be defined in the eXSpy preferences, which can be done through :func:`hyperspy.api.preferences.gui` or the :attr:`hyperspy.api.preferences.EELS.eels_gos_files_path` variable. From 41acbcf6f14ff9c3f775ebcd54710514af9f612c Mon Sep 17 00:00:00 2001 From: Eric Prestat Date: Tue, 11 Jun 2024 13:14:41 +0100 Subject: [PATCH 5/5] Add changelog entries --- upcoming_changes/55.bugfix.rst | 1 + upcoming_changes/55.doc.rst | 1 + 2 files changed, 2 insertions(+) create mode 100644 upcoming_changes/55.bugfix.rst create mode 100644 upcoming_changes/55.doc.rst diff --git a/upcoming_changes/55.bugfix.rst b/upcoming_changes/55.bugfix.rst new file mode 100644 index 000000000..2c5523ee9 --- /dev/null +++ b/upcoming_changes/55.bugfix.rst @@ -0,0 +1 @@ +Fix gradients of the :class:`~.components.EELSArctan` component. \ No newline at end of file diff --git a/upcoming_changes/55.doc.rst b/upcoming_changes/55.doc.rst new file mode 100644 index 000000000..38da8c411 --- /dev/null +++ b/upcoming_changes/55.doc.rst @@ -0,0 +1 @@ +Fix broken links in the documentation and missing docstring of the :class:`~.components.PESCoreLineShape` component in the API reference. \ No newline at end of file