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

# Conflicts:
#	.github/workflows/nightly-merge.yml
#	.github/workflows/release.yml
  • Loading branch information
ericpre committed Apr 9, 2023
2 parents 7276fd0 + ccc5f8c commit f5203eb
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/nightly-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3.3.0
uses: actions/checkout@v3

- name: Nightly Merge
uses: robotology/gh-action-nightly-merge@22f5e45d028f22837d617fa07512925457eec184
uses: robotology/gh-action-nightly-merge@f9e5f76d2c4e3fbfa5d44c6ee414b46b336df504
with:
stable_branch: 'RELEASE_next_patch'
development_branch: 'RELEASE_next_minor'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
python -m build --sdist
- name: Build manylinux Python wheels
uses: RalfG/python-wheels-manylinux-build@ae10a67945b323e502c46eee6df55b7658e01670
uses: RalfG/python-wheels-manylinux-build@ff8504699f7a33a08d3ff85b3c6d4e8f0e70462b
with:
python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310'
build-requirements: 'cython'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
PYTHON_VERSION: '3.7'
PIP_SELECTOR: '[all, tests, coverage]'
OLDEST_SUPPORTED_VERSION: true
DEPENDENCIES: matplotlib==3.1.3 numpy==1.17.1 scipy==1.4 imagecodecs==2020.1.31 tifffile==2020.2.16 dask==2.11.0 distributed==2.11.0 scikit-image==0.15 numba==0.52 scikit-learn==1.0.1
DEPENDENCIES: matplotlib==3.1.3 numpy==1.19.0 scipy==1.4 imagecodecs==2020.1.31 tifffile==2020.2.16 dask==2.11.0 distributed==2.11.0 scikit-image==0.15 numba==0.52 scikit-learn==1.0.1
LABEL: -oldest
# test minimum requirement
- os: ubuntu
Expand Down
4 changes: 4 additions & 0 deletions hyperspy/drawing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ def contrast_stretching(data, vmin=None, vmax=None):
calculation (in case of string values).
"""
if np.issubdtype(data.dtype, bool):
# in case of boolean, simply return 0, 1
return 0, 1

def _parse_value(value, value_name):
if value is None:
if value_name == "vmin":
Expand Down
7 changes: 7 additions & 0 deletions hyperspy/tests/drawing/test_plot_signal2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,3 +711,10 @@ def test_plot_scalebar_list():
ax0, ax1 = hs.plot.plot_images([s, s], scalebar=[0])
assert hasattr(ax0, 'scalebar')
assert not hasattr(ax1, 'scalebar')


def test_plot_images_bool():
data = np.arange(100).reshape((10, 10)) > 50
s = hs.signals.Signal2D(data)

hs.plot.plot_images(s)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

install_req = ['scipy>=1.4.0',
'matplotlib>=3.1.3',
'numpy>=1.17.1',
'numpy>=1.19.0',
'traits>=4.5.0',
'natsort',
'requests',
Expand Down
1 change: 1 addition & 0 deletions upcoming_changes/3118.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix plotting boolean array with :py:func:`~.drawing.utils.plot_images`

0 comments on commit f5203eb

Please sign in to comment.