Skip to content

Commit

Permalink
Merge pull request #2464 from francisco-dlp/RELEASE_v1.6
Browse files Browse the repository at this point in the history
Release v1.6
  • Loading branch information
francisco-dlp committed Aug 5, 2020
2 parents d841dd8 + 0416c85 commit b56ee0d
Show file tree
Hide file tree
Showing 11 changed files with 203 additions and 32 deletions.
182 changes: 173 additions & 9 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,184 @@
What's new
**********

We only cover here the main highlights, for a detailed list of all the changes
see `the commits in the GITHUB milestones
<https://github.com/hyperspy/hyperspy/milestones?state=closed>`__.

Current Version
===============

.. _changes_1.6:

v1.6
++++

NEW
---

* Support for the following file formats:

* :ref:`sur-format`
* :ref:`elid_format-label`
* :ref:`nexus-format`
* :ref:`usid-format`
* :ref:`empad-format`
* Prismatic EMD format, see :ref:`emd-format`
* :meth:`~._signals.eels.EELSSpectrum_mixin.print_edges_near_energy` method
that, if the `hyperspy-gui-ipywidgets package
<https://github.com/hyperspy/hyperspy_gui_ipywidgets>`_
is installed, includes an
awesome interactive mode. See :ref:`eels_elemental_composition-label`.
* Model asymmetric line shape components:

* :py:class:`~._components.doniach.Doniach`
* :py:class:`~._components.split_pvoigt.SplitVoigt`
* :ref:`EDS absorption correction <eds_absorption-label>`.
* :ref:`Argand diagram for complex signals <complex.argand>`.
* :ref:`Multiple peak finding algorithms for 2D signals <peak_finding-label>`.
* :ref:`cluster_analysis-label`.

Enhancements
------------

* The :py:meth:`~.signal.BaseSignal.get_histogram` now uses numpy's
`np.histogram_bin_edges()
<https://numpy.org/doc/stable/reference/generated/numpy.histogram_bin_edges.html>`_
and supports all of its ``bins`` keyword values.
* Further improvements to the contrast adjustment tool.
Test it by pressing the ``h`` key on any image.
* The following components have been rewritten using
:py:class:`hyperspy._components.expression.Expression`, boosting their
speeds among other benefits.

* :py:class:`hyperspy._components.arctan.Arctan`
* :py:class:`hyperspy._components.voigt.Voigt`
* :py:class:`hyperspy._components.heaviside.HeavisideStep`
* The model fitting :py:meth:`~.model.BaseModel.fit` and
:py:meth:`~.model.BaseModel.multifit` methods have been vastly improved. See
:ref:`model.fitting` and the API changes section below.
* New serpentine iteration path for multi-dimensional fitting.
See :ref:`model.multidimensional-label`.
* The :py:func:`~.drawing.utils.plot_spectra` function now listens to
events to update the figure automatically.
See :ref:`this example <plot_profiles_interactive-label>`.
* Improve thread-based parallelism. Add ``max_workers`` argument to the
:py:meth:`~.signal.BaseSignal.map` method, such that the user can directly
control how many threads they launch.
* Many improvements to the :py:meth:`~.mva.MVA.decomposition` and
:py:meth:`~.mva.MVA.blind_source_separation` methods, including support for
scikit-learn like algorithms, better API and much improved documentation.
See :ref:`ml-label` and the API changes section below.
* Add option to calculate the absolute thickness to the EELS
:meth:`~._signals.eels.EELSSpectrum_mixin.estimate_thickness` method.
See :ref:`eels_thickness-label`.
* Vastly improved performance and memory footprint of the
:py:meth:`~._signals.signal2d.Signal2D.estimate_shift2D` method.
* The :py:meth:`~._signals.signal1d.Signal1D.remove_background` method can
now remove Doniach, exponential, Lorentzian, skew normal,
split Voigt and Voigt functions. Furthermore, it can return the background
model that includes an estimation of the reduced chi-squared.
* The performance of the maximum-likelihood PCA method was greatly improved.
* All ROIs now have a ``__getitem__`` method, enabling e.g. using them with the
unpack ``*`` operator. See :ref:`roi-slice-label` for an example.
* New syntax to set the contrast when plotting images. In particular, the
``vmin`` and ``vmax`` keywords now take values like ``vmin="30th"`` to
clip the minimum value to the 30th percentile. See :ref:`signal.fft`
for an example.
* The :py:meth:`~._signals.signal1d.Signal1D.plot` and
:py:meth:`~._signals.signal2d.Signal2D.plot` methods take a new keyword
argument ``autoscale``. See :ref:`plot.customize_images` for details.
* The contrast editor and the decomposition methods can now operate on
complex signals.
* The default colormap can now be set in
:ref:`preferences <configuring-hyperspy-label>`.


API changes
-----------

* The :py:meth:`~._signals.signal2d.Signal2D.plot` keyword argument
``saturated_pixels`` is deprecated. Please use
``vmin`` and/or ``vmax`` instead.
* The :py:func:`~.io.load` keyword argument ``dataset_name`` has been
renamed to ``dataset_path``.
* The :py:meth:`~.signal.BaseSignal.set_signal_type` method no longer takes
``None``. Use the empty string ``""`` instead.
* The :py:meth:`~.signal.BaseSignal.get_histogram` ``bins`` keyword values
have been renamed as follows for consistency with numpy:

* ``"scotts"`` -> ``"scott"``,
* ``"freedman"`` -> ``"fd"``
* Multiple changes to the syntax of the :py:meth:`~.model.BaseModel.fit`
and :py:meth:`~.model.BaseModel.multifit` methods:

* The ``fitter`` keyword has been renamed to ``optimizer``.
* The values that the ``optimizer`` keyword take have been renamed
for consistency with scipy:

* ``"fmin"`` -> ``"Nelder-Mead"``,
* ``"fmin_cg"`` -> ``"CG"``,
* ``"fmin_ncg"`` -> ``"Newton-CG"``,
* ``"fmin_bfgs"`` -> ``"BFGS"``,
* ``"fmin_l_bfgs_b"`` -> ``"L-BFGS-B"``,
* ``"fmin_tnc"`` -> ``"TNC"``,
* ``"fmin_powell"`` -> ``"Powell"``,
* ``"mpfit"`` -> ``"lm"`` (in combination with ``"bounded=True"``),
* ``"leastsq"`` -> ``"lm"``,

* Passing integer arguments to ``parallel`` to select the number of
workers is now deprecated. Use ``parallel=True, max_workers={value}``
instead.
* The ``method`` keyword has been renamed to ``loss_function``.
* The ``loss_function`` value ``"ml"`` has been renamed to ``"ML-poisson"``.
* The ``grad`` keyword no longer takes boolean values. It takes the
following values instead: ``"fd"``, ``"analytical"``, callable or ``None``.
* The ``ext_bounding`` keyword has been deprecated and will be removed. Use
``bounded=True`` instead.
* The ``min_function`` keyword argument has been deprecated and will
be removed. Use ``loss_function`` instead.,
* The ``min_function_grad`` keyword arguments has been deprecated and will be
removed. Use ``grad`` instead.
* The ``iterpath`` default will change from ``'flyback'`` to
``'serpentine'`` in HyperSpy version 2.0.

* The following :py:class:`~.model.BaseModel` methods are now private:

* :py:meth:`~.model.BaseModel.set_boundaries`
* :py:meth:`~.model.BaseModel.set_mpfit_parameters_info`
* :py:meth:`~.model.BaseModel.set_boundaries`

* The ``comp_label`` keyword of the machine learning plotting functions
has been renamed to ``title``.
* The :py:class:`~.learn.rpca.orpca` constructor's ``learning_rate``
keyword has been renamed to ``subspace_learning_rate``
* The :py:class:`~.learn.rpca.orpca` constructor's ``momentum``
keyword has been renamed to ``subspace_momentum``
* The :py:class:`~.learn.svd_pca.svd_pca` constructor's ``centre`` keyword
values have been renamed as follows:

* ``"trials"`` -> ``"navigation"``
* ``"variables"`` -> ``"signal"``
* The ``bounds`` keyword argument of the
:py:meth:`~._signals.lazy.decomposition` is deprecated and will be removed.
* Several syntax changes in the :py:meth:`~.learn.mva.decomposition` method:

* Several ``algorithm`` keyword values have been renamed as follows:

* ``"svd"``: ``"SVD"``,
* ``"fast_svd"``: ``"SVD"``,
* ``"nmf"``: ``"NMF"``,
* ``"fast_mlpca"``: ``"MLPCA"``,
* ``"mlpca"``: ``"MLPCA"``,
* ``"RPCA_GoDec"``: ``"RPCA"``,
* The ``polyfit`` argument has been deprecated and will be removed.
Use ``var_func`` instead.

.. _changes_1.5.2:

Previous Versions
=================

v1.5.2
++++++

Expand Down Expand Up @@ -84,15 +257,6 @@ For developers
Changelog
*********

Previous Versions
=================


We only cover here the main highlights, for a detailed list of all the changes
see `the commits in the GITHUB milestones
<https://github.com/hyperspy/hyperspy/milestones?state=closed>`__.


.. _changes_1.4.2:

v1.4.2
Expand Down
2 changes: 1 addition & 1 deletion doc/user_guide/cluster.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

.. _cluster_analysis-label:

Cluster analysis
================
Expand Down
2 changes: 2 additions & 0 deletions doc/user_guide/eds.rst
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,8 @@ number of atoms per pixel for each element.
rather than spectrum images, the pixel area should be added to the
metadata as above.

.. _eds_absorption-label:

Absorption Correction
^^^^^^^^^^^^^^^^^^^^^

Expand Down
7 changes: 7 additions & 0 deletions doc/user_guide/eels.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ many useful feature from its parent class that are documented in previous
chapters.


.. _eels_elemental_composition-label:

Elemental composition of the sample
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -50,6 +52,8 @@ they are arranged in the order closest to 849 eV.
>>> get_edges_near_energy(849, width=6)
['La_M4', 'Fe_L1']
`
The static method :py:meth:`~._signals.eels.EELSSpectrum_mixin.print_edges_near_energy`
in :py:class:`~._signals.eels.EELSSpectrum` will print out a table containing
more information about the edges.
Expand Down Expand Up @@ -91,6 +95,9 @@ to aid identification of edges.

Labels of edges can be put or remove by toggling the edge buttons.


.. _eels_thickness-label:

Thickness estimation
^^^^^^^^^^^^^^^^^^^^

Expand Down
18 changes: 2 additions & 16 deletions doc/user_guide/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1078,21 +1078,7 @@ HDF5 file. All other keyword arguments will be passed to
Note that the model and other secondary data artifacts linked to the signal are not
written to the file but these can be implemented at a later stage.


.. _elid-format:

Phenom ELID format
------------------

This is the file format used by the software package Element Identification for the Thermo
Fisher Scientific Phenom desktop SEM. It is a proprietary binary format which can contain
images, single EDS spectra, 1D line scan EDS spectra and 2D EDS spectrum maps. The reader
will convert all signals and its metadata into hyperspy signals.

The current implementation supports ELID files created with Element Identification version
3.8.0 and later. You can convert older ELID files by loading the file into a recent Element
Identification release and then save the ELID file into the newer file format.

.. _nexus-format:

Nexus
-----
Expand Down Expand Up @@ -1474,7 +1460,7 @@ filename of the ``raw`` file is defined in the ``xml`` file, which implies
changing the file name of the ``raw`` file will break reading the file.


.. _elid-format:
.. _elid_format-label:

Phenom ELID format
------------------
Expand Down
2 changes: 2 additions & 0 deletions doc/user_guide/model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,8 @@ undesired spectral channels from the fitting process:
* :py:meth:`~.models.model1d.Model1D.remove_signal_range`
* :py:meth:`~.models.model1d.Model1D.reset_signal_range`

.. _model.multidimensional-label:

Fitting multidimensional datasets
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
1 change: 1 addition & 0 deletions doc/user_guide/signal2d.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ linear ramp is at the origin and the slopes are given in units of the axis
with the according scale taken into account. Both are available via the
:py:class:`~.axes.AxesManager` of the signal.

.. _peak_finding-label:

Peak finding
------------
Expand Down
3 changes: 3 additions & 0 deletions doc/user_guide/visualisation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -975,6 +975,9 @@ and "overlap" styles:

Plotting on existing matplotlib axes.


.. _plot_profiles_interactive-label:

Plotting profiles interactively
-------------------------------

Expand Down
2 changes: 1 addition & 1 deletion hyperspy/Release.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# When running setup.py the ".dev" string will be replaced (if possible)
# by the output of "git describe" if git is available or the git
# hash if .git is present.
version = "1.6.dev"
version = "1.6.0"
description = "Multidimensional data analysis toolbox"
license = 'GPL v3'

Expand Down
3 changes: 2 additions & 1 deletion hyperspy/drawing/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ def configure(self):
yaxis.axis[0] - yaxis.scale / 2.]
self._calculate_aspect()
if self.saturated_pixels is not None:
_logger.warning("`saturated_pixels` is deprecated and will be "
from hyperspy.exceptions import VisibleDeprecationWarning
VisibleDeprecationWarning("`saturated_pixels` is deprecated and will be "
"removed in 2.0. Please use `vmin` and `vmax` "
"instead.")
self._vmin_percentile = self.saturated_pixels / 2
Expand Down
13 changes: 9 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
setup_path = os.path.dirname(__file__)


install_req = ['scipy>=0.17',
install_req = ['scipy>=1.0.1',
'matplotlib>=2.2.3',
'numpy>=1.11, !=1.13.0',
'numpy>=1.13.0',
'traits>=4.5.0',
'natsort',
'requests',
Expand All @@ -57,9 +57,9 @@
'h5py>=2.3',
'python-dateutil>=2.5.0',
'ipyparallel',
'dask[array]>=0.18, !=2.0',
'dask[array]>2.0',
'scikit-image>=0.15',
'pint>=0.8',
'pint>=0.10',
'statsmodels',
'numexpr',
'sparse',
Expand Down Expand Up @@ -354,6 +354,11 @@ def __exit__(self, type, value, traceback):
'tests/io/emd_files/fei_emd_files.zip',
'tests/io/protochips_data/*.npy',
'tests/io/protochips_data/*.csv',
'tests/io/nexus_files/*.nxs',
'tests/io/empad_data/*.xml',
'tests/io/phenom_data/*.elid',
'tests/io/sur_data/*.pro',
'tests/io/sur_data/*.sur',
'tests/signal/data/test_find_peaks1D_ohaver.hdf5',
'tests/signal/data/*.hspy',
'hyperspy_extension.yaml',
Expand Down

0 comments on commit b56ee0d

Please sign in to comment.