Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/RELEASE_next_patch' into RELEA…
Browse files Browse the repository at this point in the history
…SE_next_minor
  • Loading branch information
ericpre committed Aug 30, 2022
2 parents 075f99d + 91d0ab3 commit 6a68fc4
Show file tree
Hide file tree
Showing 65 changed files with 269 additions and 210 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Docs

on: [push, pull_request]

jobs:
build_doc:
name: Docs (PR comments)
runs-on: ubuntu-latest
env:
BUILD_DEPS: python3-dev build-essential graphviz
LATEX_DEPS: dvipng latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended

steps:
- uses: actions/checkout@v3

- uses: ericpre/sphinx-action@latest_sphinx
with:
pre-build-command: "apt-get update -y && apt-get install -y ${{ env.BUILD_DEPS }} ${{ env.LATEX_DEPS }} && pip install .[all,build-doc]"
build-command: make html
docs-folder: doc/

- uses: actions/upload-artifact@v3
with:
path: ./doc/_build/html/
name: doc_build

check_links:
# This build is to check external links
name: Check external links
runs-on: ubuntu-latest
env:
DOCS_PATH: ./doc/_build/html/
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-python@v3
name: Install Python
with:
python-version: '3.10'

- name: Install build docs
shell: bash -l {0}
run: |
pip install .[build-doc]
- name: Check links
shell: bash -l {0}
run: |
cd doc
make linkcheck
23 changes: 0 additions & 23 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,26 +84,3 @@ jobs:
- name: Upload coverage to Codecov
if: ${{ always() }} && ${{ matrix.PYTEST_ARGS_COVERAGE }}
uses: codecov/codecov-action@v2

build_doc:
name: Build doc
runs-on: ubuntu-latest
env:
BUILD_DEPS: python3-dev build-essential graphviz
LATEX_DEPS: dvipng latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended

steps:
- uses: actions/checkout@v3

- uses: ericpre/sphinx-action@latest_sphinx
with:
# once numba 0.55 is release, remove "--pre" option to "pip install"
pre-build-command: "apt-get update -y && apt-get install -y ${{ env.BUILD_DEPS }} ${{ env.LATEX_DEPS }} && pip install --pre .[all,build-doc]"
build-command: make html
docs-folder: doc/

- uses: actions/upload-artifact@v3
with:
path: ./doc/_build/html/
name: doc_build

10 changes: 10 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@
'sphinxcontrib.towncrier',
]

linkcheck_ignore = [
'https://www.jstor.org/stable/24307705', # 403 Client Error: Forbidden for url
'https://anaconda.org', # 403 Client Error: Forbidden for url
]

linkcheck_exclude_documents = [
'user_guide/io/*',
'api/hyperspy.io_plugins*',
]

try:
import sphinxcontrib.spelling
extensions.append('sphinxcontrib.spelling')
Expand Down
3 changes: 1 addition & 2 deletions doc/user_guide/axes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ can be set and retrieved as quantity.
<undefined> | 10 | | 2.5 | 2.5e+03 | nm
Internally, HyperSpy uses the `pint <http://pint.readthedocs.io>`_ library to
Internally, HyperSpy uses the `pint <https://pint.readthedocs.io>`_ library to
manage the scale and offset quantities. The ``scale_as_quantity`` and
``offset_as_quantity`` attributes return pint object:

Expand Down Expand Up @@ -685,4 +685,3 @@ and a manually specified length as inputs:
>>> from hyperspy.axes import GeneratorLen
>>> gen = GeneratorLen(reverse_flyback_generator(), 6)
>>> s.axes_manager.iterpath = gen
6 changes: 3 additions & 3 deletions doc/user_guide/bibliography.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Bibliography
of Atomic Form Factors, Photoelectric Absorption and Scattering Cross
Section, and Mass Attenuation Coefficients for Z = 1-92 from E = 1-10 eV
to E = 0.4-1.0 MeV" *NIST Standard Reference Data*
[`<http://physics.nist.gov/ffast>`_].
[`<https://physics.nist.gov/ffast>`_].

.. _Egerton2011:

Expand Down Expand Up @@ -199,9 +199,9 @@ Bibliography
.. _Lerotic2004:

:ref:`[Lerotic2004] <Lerotic2004>`
M Lerotic, C Jacobsen, T Schafer, S Vogt
M Lerotic, C Jacobsen, T Schafer, S Vogt
"Cluster analysis of soft X-ray spectromicroscopy data".
Ultramicroscopy 100 (2004) 35–57
Ultramicroscopy 100 (2004) 35–57
[`<https://doi.org/10.1016/j.ultramic.2004.01.008>`_]

.. _Iakoubovskii2008:
Expand Down
2 changes: 1 addition & 1 deletion doc/user_guide/eds.rst
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ EDS curve fitting

The intensity of X-ray lines can be extracted using curve-fitting in HyperSpy.
This example uses an EDS-SEM spectrum of a test material (EDS-TM001) provided
by `BAM <http://www.webshop.bam.de>`_.
by `BAM <https://www.webshop.bam.de>`_.

First, we load the spectrum, define the chemical composition of the sample and
set the beam energy:
Expand Down
36 changes: 17 additions & 19 deletions doc/user_guide/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Starting Python in Linux and MacOS
You can start IPython by opening a system terminal and executing ``ipython``,
(optionally followed by the "frontend": "qtconsole" for example). However, in
most cases, **the most agreeable way** to work with HyperSpy interactively
is using the `Jupyter Notebook <http://jupyter.org>`_ (previously known as
is using the `Jupyter Notebook <https://jupyter.org>`_ (previously known as
the IPython Notebook), which can be started as follows:

.. code-block:: bash
Expand All @@ -38,7 +38,7 @@ Starting HyperSpy in the notebook (or terminal)
-----------------------------------------------
Typically you will need to `set up IPython for interactive plotting with
matplotlib
<http://ipython.readthedocs.org/en/stable/interactive/plotting.html>`_ using
<https://ipython.readthedocs.org/en/stable/interactive/plotting.html>`_ using
``%matplotlib`` (which is known as a 'Jupyter magic')
*before executing any plotting command*. So, typically, after starting
IPython, you can import HyperSpy and set up interactive matplotlib plotting by
Expand Down Expand Up @@ -70,9 +70,9 @@ and the
Possible warnings when importing HyperSpy?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

HyperSpy supports different GUIs and
`matplotlib backends <https://matplotlib.org/tutorials/introductory/usage.html#backends>`_
which in specific cases can lead to warnings when importing HyperSpy. Most of the time
HyperSpy supports different GUIs and
`matplotlib backends <https://matplotlib.org/stable/users/explain/backends.html>`_
which in specific cases can lead to warnings when importing HyperSpy. Most of the time
there is nothing to worry about — the warnings simply inform you of several choices you have.
There may be several causes for a warning, for example:

Expand Down Expand Up @@ -102,8 +102,8 @@ These warnings can be turned off using the
.. versionchanged:: v1.3
HyperSpy works with all matplotlib backends, including the ``notebook``
(also called ``nbAgg``) backend that enables interactive plotting embedded
HyperSpy works with all matplotlib backends, including the ``notebook``
(also called ``nbAgg``) backend that enables interactive plotting embedded
in the jupyter notebook.


Expand Down Expand Up @@ -134,26 +134,24 @@ accessed by adding a question mark to the name of a function. e.g.:
This syntax is a shortcut to the standard way one of displaying the help
associated to a given functions (docstring in Python jargon) and it is one of
the many features of `IPython <http://ipython.scipy.org/moin/>`_, which is the
the many features of `IPython <https://ipython.readthedocs.io/>`_, which is the
interactive python shell that HyperSpy uses under the hood.

Please note that the documentation of the code is a work in progress, so not
all the objects are documented yet.

Up-to-date documentation is always available in `the HyperSpy website.
<http://hyperspy.org/documentation.html>`_
<https://hyperspy.org/documentation.html>`_


Autocompletion
--------------

Another useful `IPython <http://ipython.scipy.org/moin/>`_ feature is the
autocompletion of commands and filenames using the tab and arrow keys. It is
highly recommended to read the `Ipython documentation
<http://ipython.scipy.org/moin/Documentation>`_ (specially their `Getting
started <http://ipython.org/ipython-doc/stable/interactive/tutorial.html>`_
section) for many more useful features that will boost your efficiency when
working with HyperSpy/Python interactively.
Another useful IPython feature is the
`autocompletion <https://ipython.readthedocs.io/en/stable/interactive/tutorial.html#tab-completion>`_
of commands and filenames using the tab and arrow keys. It is highly recommended
to read the `Ipython introduction <https://ipython.readthedocs.io/en/stable/interactive/tutorial.html>`_ for many more useful features that will
boost your efficiency when working with HyperSpy/Python interactively.


Loading data
Expand All @@ -176,7 +174,7 @@ the use of a specific IO-plugin, you can provide the ``reader`` attribute:
.. note::

When the file contains several datasets, the :py:func:`~.io.load` function
will return a list of HyperSpy signals, instead of a single HyperSpy signal.
will return a list of HyperSpy signals, instead of a single HyperSpy signal.
Each signal can then be accessed using list indexation.

.. code-block:: python
Expand All @@ -188,7 +186,7 @@ the use of a specific IO-plugin, you can provide the ``reader`` attribute:
<Signal1D, title: ham, dimensions: (32,32|1024)>]
Using indexation to access the first signal (index 0):

.. code-block:: python
>>> s[0]
Expand Down Expand Up @@ -261,7 +259,7 @@ experimental data.
.. _eelsdb-label:

The :py:func:`~.misc.eels.eelsdb.eelsdb` function in `hs.datasets` can
directly load spectra from `The EELS Database <http://eelsdb.eu>`_. For
directly load spectra from `The EELS Database <https://eelsdb.eu>`_. For
example, the following loads all the boron trioxide spectra currently
available in the database:

Expand Down
21 changes: 10 additions & 11 deletions doc/user_guide/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ Installation using pip
----------------------

HyperSpy is listed in the `Python Package Index
<http://pypi.python.org/pypi>`_. Therefore, it can be automatically downloaded
and installed `pip <http://pypi.python.org/pypi/pip>`__. You may need to
<https://pypi.python.org/pypi>`_. Therefore, it can be automatically downloaded
and installed `pip <https://pypi.python.org/pypi/pip>`__. You may need to
install pip for the following commands to run.

To install all of HyperSpy's functionalities, run:
Expand All @@ -170,9 +170,9 @@ See the following list of selectors to select the installation of optional
dependencies required by specific functionalities:

* ``learning`` for some machine learning features,
* ``gui-jupyter`` to use the `Jupyter widgets <http://ipywidgets.readthedocs.io/en/stable/>`_
* ``gui-jupyter`` to use the `Jupyter widgets <https://ipywidgets.readthedocs.io/en/stable/>`_
GUI elements,
* ``gui-traitsui`` to use the GUI elements based on `traitsui <http://docs.enthought.com/traitsui/>`_,
* ``gui-traitsui`` to use the GUI elements based on `traitsui <https://docs.enthought.com/traitsui/>`_,
* ``mrcz`` to read mrcz file,
* ``speed`` to speed up some functionalities,
* ``usid`` to read usid file,
Expand Down Expand Up @@ -271,7 +271,7 @@ Clone the hyperspy repository
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

To get the development version from our git repository you need to install `git
<http://git-scm.com//>`_. Then just do:
<https://git-scm.com//>`_. Then just do:

.. code-block:: bash
Expand All @@ -287,8 +287,8 @@ To get the development version from our git repository you need to install `git

Installation in a Anaconda/Miniconda distribution
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Optionally, create an environment to separate your hyperspy installation from
other anaconda environments (`read more about environments here
Optionally, create an environment to separate your hyperspy installation from
other anaconda environments (`read more about environments here
<https://conda.io/projects/conda/en/latest/user-guide/concepts/environments.html>`_):

.. code-block:: bash
Expand All @@ -307,7 +307,7 @@ The package ``hyperspy-dev`` will install the development dependencies required
for testing and building the documentation.

From the root folder of your hyperspy repository (folder containing the
``setup.py`` file) run `pip <http://www.pip-installer.org>`_ in development mode:
``setup.py`` file) run `pip <https://pip.pypa.io/>`_ in development mode:

.. code-block:: bash
Expand All @@ -317,7 +317,7 @@ Installation in other (non-system) Python distribution
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

From the root folder of your hyperspy repository (folder containing the
``setup.py`` file) run `pip <http://www.pip-installer.org>`_ in development mode:
``setup.py`` file) run `pip <https://pip.pypa.io/>`_ in development mode:

.. code-block:: bash
Expand All @@ -341,7 +341,7 @@ When using a system Python distribution, it is recommended to install the
dependencies using your system package manager.

From the root folder of your hyperspy repository (folder containing the
``setup.py`` file) run `pip <http://www.pip-installer.org>`_ in development mode.
``setup.py`` file) run `pip <https://pip.pypa.io/>`_ in development mode.

.. code-block:: bash
Expand All @@ -361,4 +361,3 @@ You can create binaries for Debian/Ubuntu from the source by running the

For this to work, the following packages must be installed in your system
python-stdeb, debhelper, dpkg-dev and python-argparser are required.

2 changes: 1 addition & 1 deletion doc/user_guide/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,5 @@ that sets its character:
and
`hyperspy-gui-traitsui <https://github.com/hyperspy/hyperspy_gui_traitsui>`_
packages for details. Not enough? If you
need a full, standalone GUI, `HyperSpyUI <http://hyperspy.org/hyperspyUI/>`_
need a full, standalone GUI, `HyperSpyUI <https://hyperspy.org/hyperspyUI/>`_
is for you.
16 changes: 8 additions & 8 deletions doc/user_guide/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ functions, e.g.:
>>> s = hs.load(["file1.hspy", "file2.hspy"])
or by using `shell-style wildcards <http://docs.python.org/library/glob.html>`_:
or by using `shell-style wildcards <https://docs.python.org/library/glob.html>`_:

.. code-block:: python
Expand Down Expand Up @@ -1905,7 +1905,7 @@ Extra loading arguments
acquired last frame, which typically occurs when the acquisition was
interrupted. When loading incomplete data (``only_valid_data=False``),
the missing data are filled with zeros. If ``sum_frames=True``, this argument
will be ignored to enforce consistent sum over the mapped area.
will be ignored to enforce consistent sum over the mapped area.
- ``read_em_image`` : bool, default False.
for ``pts`` file only, If ``read_em_image=True``,
read SEM/STEM image from pts file if available. In this case, both
Expand Down Expand Up @@ -1953,8 +1953,8 @@ TVIPS format

The TVIPS format is the default format for image series collected by pixelated
cameras from the TVIPS company. Typically individual images captured by these
cameras are stored in the :ref:`TIFF format<tiff-format>` which can also be
loaded by Hyperspy. This format instead serves to store image streams from
cameras are stored in the :ref:`TIFF format<tiff-format>` which can also be
loaded by Hyperspy. This format instead serves to store image streams from
in-situ and 4D-STEM experiments. During collection, the maximum file size is
typically capped meaning the dataset is typically split over multiple files
ending in `_xyz.tvips`. The `_000.tvips` will contain the main header and
Expand All @@ -1969,7 +1969,7 @@ will not work if no such file is found.
interoperability with the official software can neither be guaranteed.

.. warning::

The TVIPS format currently stores very limited amount of metadata about
scanning experiments. To reconstruct scan data, e.g. 4D-STEM datasets,
parameters like the shape and scales of the scan dimensions should be
Expand All @@ -1982,7 +1982,7 @@ Extra loading arguments
in the x direction. If this argument is not provided, the data will be loaded
as a 1D stack of images. `auto` is also an option which aims to reconstruct
the scan based on the `rotidx` indices in frame headers. Since this only
works for square scan grids and is prone to failure, this option is not
works for square scan grids and is prone to failure, this option is not
recommended.
- ``scan_start_frame``: index of the first frame of the dataset to consider,
mainly relevant for 4D-STEM datasets. If `scan_shape="auto"` this parameter
Expand All @@ -2002,11 +2002,11 @@ Extra loading arguments
default setting of `auto` rechunking is performed such that the navigation axes
are optimally chunked and the signal axes are not chunked. If set to anything else, the
value will be passed to the `chunks` argument in `dask.array.rechunk`.

Extra saving arguments
^^^^^^^^^^^^^^^^^^^^^^

- ``max_file_size``: approximate maximum size of individual files in bytes.
- ``max_file_size``: approximate maximum size of individual files in bytes.
In this way a dataset can be split into multiple files. A file needs to be
at least the size of the main header in the first file plus one frame and its
frame header. By default there is no maximum and the entire dataset is saved
Expand Down

0 comments on commit 6a68fc4

Please sign in to comment.