Hyperspy

Latest version: v2.3.0

Safety actively analyzes 723177 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 9

1.6.0

===================

NEW
---

* Support for the following file formats:

* :external+rsciio:ref:`digitalsurf-format`
* :external+rsciio:ref:`elid-format`
* :external+rsciio:ref:`nexus-format`
* :external+rsciio:ref:`usid-format`
* :external+rsciio:ref:`empad-format`
* Prismatic EMD format, see :external+rsciio:ref:`emd-format`
* ``hyperspy._signals.eels.EELSSpectrum.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 :external+exspy:ref:`eels_elemental_composition-label`.
* Model asymmetric line shape components:

* :py:class:`~._components.doniach.Doniach`
* :py:class:`~._components.split_voigt.SplitVoigt`
* :external+exspy: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:`~.api.signals.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:`~._components.expression.Expression`, boosting their
speeds among other benefits.

* :py:class:`~._components.arctan.Arctan`
* :py:class:`~._components.voigt.Voigt`
* :py:class:`~._components.heaviside.HeavisideStep`
* The model fitting :py:meth:`~hyperspy.model.BaseModel.fit` and
:py:meth:`~hyperspy.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:`~.api.plot.plot_spectra` function now listens to
events to update the figure automatically.
See :ref:`this example <sphx_glr_auto_examples_region_of_interest_ExtractLineProfile.py>`.
* Improve thread-based parallelism. Add ``max_workers`` argument to the
:py:meth:`~.api.signals.BaseSignal.map` method, such that the user can directly
control how many threads they launch.
* Many improvements to the :py:meth:`~.api.signals.BaseSignal.decomposition` and
:py:meth:`~.api.signals.BaseSignal.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
``hyperspy._signals.eels.EELSSpectrum.estimate_thickness`` method.
See :external+exspy:ref:`eels_thickness-label`.
* Vastly improved performance and memory footprint of the
:py:meth:`~.api.signals.Signal2D.estimate_shift2D` method.
* The :py:meth:`~.api.signals.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:`~.api.signals.Signal1D.plot` and
:py:meth:`~.api.signals.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:`~.api.signals.Signal2D.plot` keyword argument
``saturated_pixels`` is deprecated. Please use
``vmin`` and/or ``vmax`` instead.
* The :py:func:`~.api.load` keyword argument ``dataset_name`` has been
renamed to ``dataset_path``.
* The :py:meth:`~.api.signals.BaseSignal.set_signal_type` method no longer takes
``None``. Use the empty string ``""`` instead.
* The :py:meth:`~.api.signals.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:`~hyperspy.model.BaseModel.fit`
and :py:meth:`~hyperspy.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:`~hyperspy.model.BaseModel` methods are now private:

* ``hyperspy.model.BaseModel.set_boundaries``
* ``hyperspy.model.BaseModel.set_mpfit_parameters_info``

* The ``comp_label`` keyword of the machine learning plotting functions
has been renamed to ``title``.
* The :py:class:`~hyperspy.learn.rpca.orpca` constructor's ``learning_rate``
keyword has been renamed to ``subspace_learning_rate``
* The :py:class:`~hyperspy.learn.rpca.orpca` constructor's ``momentum``
keyword has been renamed to ``subspace_momentum``
* The :py:class:`~hyperspy.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.LazySignal.decomposition` is deprecated and will be removed.
* Several syntax changes in the :py:meth:`~.api.signals.BaseSignal.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:

1.5.2

===================

This is a maintenance release that adds compatibility with Numpy 1.17 and Dask

1.5.1

===================

This is a maintenance release that fixes some regressions introduced in v1.5.
Follow the following links for details on all the `bugs fixed
<https://github.com/hyperspy/hyperspy/issues?q=label%3A"type%3A+bug"+is%3Aclosed+milestone%3Av1.5.1>`__.


.. _changes_1.5:

1.5.0

===================

NEW
---

* New method :py:meth:`hyperspy.component.Component.print_current_values`. See
:ref:`the User Guide for details <Component.print_current_values>`.
* New :py:class:`hyperspy._components.skew_normal.SkewNormal` component.
* New :py:meth:`hyperspy.api.signals.BaseSignal.apply_apodization` method and
``apodization`` keyword for :py:meth:`hyperspy.api.signals.BaseSignal.fft`. See
:ref:`signal.fft` for details.
* Estimation of number of significant components by the elbow method.
See :ref:`mva.scree_plot`.

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

* The contrast adjustment tool has been hugely improved. Test it by pressing the ``h`` key on any image.
* The :ref:`Developer Guide <dev_guide>` has been extended, enhanced and divided into
chapters.
* Signals with signal dimension equal to 0 and navigation dimension 1 or 2 are
automatically transposed when using
:py:func:`hyperspy.api.plot.plot_images`
or :py:func:`hyperspy.api.plot.plot_spectra` respectively. This is
specially relevant when plotting the result of EDS quantification. See
:external+exspy:ref:`eds-label` for examples.
* The following components have been rewritten using
:py:class:`hyperspy._components.expression.Expression`, boosting their
speeds among other benefits. Multiple issues have been fixed on the way.

* :py:class:`hyperspy._components.lorentzian.Lorentzian`
* :py:class:`hyperspy._components.exponential.Exponential`
* :py:class:`hyperspy._components.bleasdale.Bleasdale`
* :py:class:`hyperspy._components.rc.RC`
* :py:class:`hyperspy._components.logistic.Logistic`
* :py:class:`hyperspy._components.error_function.Erf`
* :py:class:`hyperspy._components.gaussian2d.Gaussian2D`
* :py:class:`exspy.components.VolumePlasmonDrude`
* :py:class:`exspy.components.DoublePowerLaw`
* The ``hyperspy._components.polynomial_deprecated.Polynomial``
component will be deprecated in HyperSpy 2.0 in favour of the new
:py:class:`hyperspy._components.polynomial.Polynomial` component, that is based on
:py:class:`hyperspy._components.expression.Expression` and has an improved API. To
start using the new component pass the ``legacy=False`` keyword to the
the ``hyperspy._components.polynomial_deprecated.Polynomial`` component
constructor.


For developers
--------------
* Drop support for python 3.5
* New extension mechanism that enables external packages to register HyperSpy
objects. See :ref:`writing_extensions-label` for details.


.. _changes_1.4.2:

1.4.2

===================

This is a maintenance release. Among many other fixes and enhancements, this
release fixes compatibility issues with Matplotlib v 3.1. Follow the
following links for details on all the `bugs fixed
<https://github.com/hyperspy/hyperspy/issues?q=label%3A"type%3A+bug"+is%3Aclosed+milestone%3Av1.4.2>`__
and `enhancements
<https://github.com/hyperspy/hyperspy/issues?q=is%3Aclosed+milestone%3Av1.4.2+label%3A"type%3A+enhancement">`__.


.. _changes_1.4.1:

1.4.1

===================

This is a maintenance release. Follow the following links for details on all
the `bugs fixed
<https://github.com/hyperspy/hyperspy/issues?q=label%3A"type%3A+bug"+is%3Aclosed+milestone%3Av1.4.1>`__
and `enhancements
<https://github.com/hyperspy/hyperspy/issues?q=is%3Aclosed+milestone%3Av1.4.1+label%3A"type%3A+enhancement">`__.

This release fixes compatibility issues with Python 3.7.


.. _changes_1.4:

Page 4 of 9

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.