diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 21dd3daf24..fa19cc339d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -54,14 +54,14 @@ jobs: python --version which python - - name: install pep517 and twine + - name: install build and twine run: | python -m pip install --upgrade pip - python -m pip install pep517 twine + python -m pip install build twine - name: Build wheels run: | - python -m pep517.build --binary --out-dir dist/ . + python -m build - name: Display content dist folder run: | @@ -105,21 +105,20 @@ jobs: run: | python -m pip install twine + - name: Build source distribution + run: | + pip install build + python -m build --sdist + - name: Build manylinux Python wheels uses: RalfG/python-wheels-manylinux-build@v0.3.3 with: python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39' build-requirements: 'cython' - - name: Build source distribution - run: | - pip install pep517 - python -m pep517.build --source --out-dir sdist/ . - - name: Display content dist folder run: | ls dist/ - ls sdist/ - name: Install and test distribution env: @@ -144,5 +143,5 @@ jobs: TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | twine upload dist/*-manylinux*.whl --verbose - twine upload sdist/*.tar.gz --verbose + twine upload dist/*.tar.gz --verbose diff --git a/CHANGES.rst b/CHANGES.rst index 6801e9e9d6..6ec38ccd6e 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -8,8 +8,34 @@ https://hyperspy.readthedocs.io/en/latest/user_guide/changes.html .. towncrier release notes start -Hyperspy 1.6.4 (2021-07-08) -=========================== +v1.6.5 (2021-10-28) +=================== + +Bug Fixes +--------- + +- Suspend plotting during :py:meth:`~.models.eelsmodel.EELSModel.smart_fit` call (`#2796 `_) +- make :py:meth:`~.signal.BaseSignal.add_marker` also check if the plot is not active before plotting signal (`#2799 `_) +- Fix irresponsive ROI added to a signal plot with a right hand side axis (`#2809 `_) +- Fix :py:func:`~.drawing.utils.plot_histograms` drawstyle following matplotlib API change (`#2810 `_) +- Fix incorrect :py:meth:`~.signal.BaseSignal.map` output size of lazy signal when input and output axes do not match (`#2837 `_) +- Add support for latest h5py release (3.5) (`#2843 `_) + + +Deprecations +------------ + +- Rename ``line_style`` to ``linestyle`` in :py:func:`~.drawing.utils.plot_spectra` to match matplotlib argument name (`#2810 `_) + + +Enhancements +------------ + +- :py:meth:`~.roi.BaseInteractiveROI.add_widget` can now take a string or integer instead of tuple of string or integer (`#2809 `_) + + +v1.6.4 (2021-07-08) +=================== Bug Fixes --------- diff --git a/hyperspy/_signals/lazy.py b/hyperspy/_signals/lazy.py index fafdb9e589..f6415d1756 100644 --- a/hyperspy/_signals/lazy.py +++ b/hyperspy/_signals/lazy.py @@ -653,7 +653,7 @@ def _map_iterate(self, axes_changed = True if len(output_signal_size) != len(old_sig.axes_manager.signal_shape): drop_axis = old_sig.axes_manager.signal_indices_in_array - new_axis = tuple(range(len(output_signal_size))) + new_axis = tuple(range(len(nav_indexes), len(nav_indexes) + len(output_signal_size))) else: drop_axis = [it for (o, i, it) in zip(output_signal_size, old_sig.axes_manager.signal_shape, diff --git a/hyperspy/tests/signals/test_map_method.py b/hyperspy/tests/signals/test_map_method.py index c537b76cc3..e97c742459 100644 --- a/hyperspy/tests/signals/test_map_method.py +++ b/hyperspy/tests/signals/test_map_method.py @@ -362,6 +362,15 @@ def test_map_iterate_array(self): inplace=False) np.testing.assert_array_equal(s_out.mean(axis=(2, 3)).data, iter_array) + @pytest.mark.parametrize("output_signal_size", [(3,), (3, 4), (3, 4, 5)]) + def test_map_output_signal_size(self, output_signal_size): + def f(data): + return np.ones(output_signal_size) + + s_out = self.s.map(function=f, inplace=False) + assert s_out.data.shape[2:] == output_signal_size + assert s_out.axes_manager.signal_shape == output_signal_size[::-1] + @pytest.mark.parametrize('ragged', [True, False, None]) def test_singleton(ragged): diff --git a/setup.py b/setup.py index 151e2cd58e..e8e5bdf8cb 100644 --- a/setup.py +++ b/setup.py @@ -46,7 +46,7 @@ install_req = ['scipy>=1.1', - 'matplotlib>=3.1.0', + 'matplotlib>=3.1.0,<3.5', 'numpy>=1.17.1', 'traits>=4.5.0', 'natsort', diff --git a/upcoming_changes/2796.bugfix.rst b/upcoming_changes/2796.bugfix.rst deleted file mode 100644 index 9e392758dd..0000000000 --- a/upcoming_changes/2796.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Suspend plotting during :py:meth:`~.models.eelsmodel.EELSModel.smart_fit` call diff --git a/upcoming_changes/2799.bugfix.rst b/upcoming_changes/2799.bugfix.rst deleted file mode 100644 index 59a17eb475..0000000000 --- a/upcoming_changes/2799.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -make :py:meth:`~.signal.BaseSignal.add_marker` also check if the plot is not active before plotting signal diff --git a/upcoming_changes/2809.bugfix.rst b/upcoming_changes/2809.bugfix.rst deleted file mode 100644 index f699b99339..0000000000 --- a/upcoming_changes/2809.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fix irresponsive ROI added to a signal plot with a right hand side axis diff --git a/upcoming_changes/2809.enhancements.rst b/upcoming_changes/2809.enhancements.rst deleted file mode 100644 index 28f313980a..0000000000 --- a/upcoming_changes/2809.enhancements.rst +++ /dev/null @@ -1 +0,0 @@ -:py:meth:`~.roi.BaseInteractiveROI.add_widget` can now take a string or integer instead of tuple of string or integer diff --git a/upcoming_changes/2810.bugfix.rst b/upcoming_changes/2810.bugfix.rst deleted file mode 100644 index 16a696ff45..0000000000 --- a/upcoming_changes/2810.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fix :py:func:`~.drawing.utils.plot_histograms` drawstyle following matplotlib API change diff --git a/upcoming_changes/2810.deprecation.rst b/upcoming_changes/2810.deprecation.rst deleted file mode 100644 index c744b236cc..0000000000 --- a/upcoming_changes/2810.deprecation.rst +++ /dev/null @@ -1 +0,0 @@ -Rename ``line_style`` to ``linestyle`` in :py:func:`~.drawing.utils.plot_spectra` to match matplotlib argument name