Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use blas accelerate and hyperspy 2.0 #98

Merged
merged 10 commits into from
Feb 11, 2024
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
push_docs:
needs: build_docs
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' && github.repository == 'hyperspy/hyperspy-bundle' }}
if: ${{ startsWith(github.ref, 'refs/tags/') && github.repository == 'hyperspy/hyperspy-bundle' }}
permissions:
# needs write permission to push the docs to gh-pages
contents: write
Expand Down
143 changes: 110 additions & 33 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ permissions:

env:
MPLBACKEND: 'agg'
TEST_DEPS: pytest pytest-qt pytest-xdist pytest-rerunfailures
# pin pytest to 7.4.4 to get the test suite of pyxem to work
TEST_DEPS: pytest==7.4.4 pytest-qt pytest-xdist pytest-rerunfailures pytest-mpl

jobs:
create_release_job:
Expand Down Expand Up @@ -67,44 +68,50 @@ jobs:
build:
name: ${{ matrix.TARGET_PLATFORM }}-${{ matrix.BLAS_IMPL }}
needs: create_release_job
runs-on: ${{ matrix.os }}-latest
runs-on: ${{ matrix.os }}-${{ matrix.os_version }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu
os_version: latest
INSTALLER_EXTENSION: sh
BLAS_IMPL: mkl
ARCH: x86_64
TARGET_PLATFORM: linux-64
- os: ubuntu
os_version: latest
INSTALLER_EXTENSION: sh
BLAS_IMPL: openblas
ARCH: x86_64
TARGET_PLATFORM: linux-64
- os: windows
os_version: latest
INSTALLER_EXTENSION: exe
BLAS_IMPL: mkl
ARCH: x86_64
TARGET_PLATFORM: win-64
- os: windows
os_version: latest
INSTALLER_EXTENSION: exe
BLAS_IMPL: openblas
ARCH: x86_64
TARGET_PLATFORM: win-64
- os: macos
os_version: latest
INSTALLER_EXTENSION: pkg
BLAS_IMPL: mkl
ARCH: x86_64
TARGET_PLATFORM: osx-64
- os: macos
os_version: 14
INSTALLER_EXTENSION: pkg
BLAS_IMPL: openblas
BLAS_IMPL: accelerate
ARCH: arm64
TARGET_PLATFORM: osx-arm64
env:
DISPLAY: ':0'
MICROMAMBA_VERSION: '1.5.1'
MICROMAMBA_VERSION: '1.5.6'

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -186,7 +193,7 @@ jobs:
bash ${{ env.asset_name }} -b -p ${{ env.install_dir }}

- name: Install new distribution (MacOS)
if: runner.os == 'macos' && matrix.ARCH == 'x86_64'
if: runner.os == 'macos'
run: |
echo "install_dir=/Users/runner" >> $GITHUB_ENV
installer -pkg ${{ env.asset_name }} -target CurrentUserHomeDirectory
Expand All @@ -213,7 +220,6 @@ jobs:
name: ${{ env.asset_name }}

- shell: bash -l {0}
if: matrix.ARCH == 'x86_64'
name: Info new distribution
run: |
conda activate "${{ env.install_dir }}"
Expand All @@ -223,7 +229,6 @@ jobs:
conda list

- shell: bash -l {0}
if: matrix.ARCH == 'x86_64'
name: Check latest available hyperspy version
run: |
conda activate "${{ env.install_dir }}"
Expand All @@ -241,48 +246,85 @@ jobs:

- shell: bash -l {0}
name: Install test dependencies
if: matrix.ARCH == 'x86_64' && always()
if: always()
run: |
conda activate "${{ env.install_dir }}"
mamba install ${{ env.TEST_DEPS }}

- shell: bash -l {0}
# TODO: revisit at some point, to get it to work on linux (hyperspyui CI works fine...)
if: runner.os != 'linux' && matrix.ARCH == 'x86_64' && always()
if: runner.os != 'linux' && always()
name: Test new distribution (HyperSpyUI)
run: |
conda activate "${{ env.install_dir }}"
pytest --pyargs hyperspyui

- shell: bash -l {0}
name: Test RosettaSciIO
if: always()
run: |
conda activate "${{ env.install_dir }}"
pytest --pyargs rsciio --reruns 3

- shell: bash -l {0}
name: Test hyperspy
if: matrix.ARCH == 'x86_64' && always()
if: always()
run: |
conda activate "${{ env.install_dir }}"
pytest --pyargs hyperspy --reruns 3 -n 2

- shell: bash -l {0}
name: Run test lumispy
if: matrix.ARCH == 'x86_64' && always()
name: Test hyperspy_gui_ipywidgets
if: always()
run: |
conda activate "${{ env.install_dir }}"
pytest --pyargs lumispy
pytest --pyargs hyperspy_gui_ipywidgets

- shell: bash -l {0}
name: Run test pyxem
if: matrix.ARCH == 'x86_64' && always()
name: Test hyperspy_gui_traitsui
if: runner.os != 'linux' && always()
run: |
conda activate "${{ env.install_dir }}"
pytest --pyargs pyxem
pytest --pyargs hyperspy_gui_traitsui -k "not test_image_contrast_tool"

- shell: bash -l {0}
name: Run test kikuchipy
if: matrix.ARCH == 'x86_64' && always()
env:
MPLBACKEND: 'agg'
name: Run test exspy
if: always()
run: |
conda activate "${{ env.install_dir }}"
pytest --pyargs exspy

- shell: bash -l {0}
name: Run test holospy
if: always()
run: |
conda activate "${{ env.install_dir }}"
pytest --pyargs holospy

- shell: bash -l {0}
name: Run test lumispy
if: always()
run: |
conda activate "${{ env.install_dir }}"
pytest --pyargs lumispy

- shell: bash -l {0}
name: Run test pyxem
if: always()
run: |
conda activate "${{ env.install_dir }}"
pytest --pyargs kikuchipy
# cause of the TestAddEllipseArrayAsMarkers failure is unknown (seems to be on blas mkl only)
# test_offest_and_scale failure fixed in https://github.com/pyxem/pyxem/pull/1016
pytest --pyargs pyxem -k "not TestAddEllipseArrayAsMarkers and not test_offest_and_scale"

# - shell: bash -l {0}
# name: Run test kikuchipy
# if: always()
# env:
# MPLBACKEND: 'agg'
# run: |
# conda activate "${{ env.install_dir }}"
# pytest --pyargs kikuchipy

- name: Upload Release Asset
if: startsWith(github.ref, 'refs/tags/')
Expand All @@ -303,7 +345,8 @@ jobs:
WP_SHA256: 0b2037660064589dd73a58ac17f44d9e657cfc5fcea92cec9223185243a0a3bc
WP_EXE: winpython.exe
WP_DIR_NAME: WPy64-31150
LIB_TO_INSTALL: abtem ase atomap graphviz hdf5plugin hyperspy[all] hyperspyui kikuchipy lumispy matplotlib-scalebar nglview particlespy py4dstem pymatgen pystackreg python-rapidjson pyxem scanning_drift_corr start_jupyter_cm
#LIB_TO_INSTALL: abtem ase atomap exspy graphviz holospy hdf5plugin hyperspy[all] hyperspyui kikuchipy lumispy matplotlib-scalebar nglview particlespy py4dstem pymatgen pystackreg python-rapidjson pyxem scanning_drift_corr start_jupyter_cm
LIB_TO_INSTALL: abtem ase exspy graphviz holospy hdf5plugin hyperspy[all] hyperspyui lumispy matplotlib-scalebar nglview particlespy py4dstem pymatgen pystackreg python-rapidjson pyxem scanning_drift_corr start_jupyter_cm

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -401,32 +444,66 @@ jobs:
shell: cmd
run: |
call "${{ env.WP_DIR_NAME }}\scripts\env.bat"
# Remove for 1.7.6 release
del WPy64-31150\python-3.11.5.amd64\Lib\site-packages\hyperspy\tests\signals\test_find_peaks2D.py
pytest --pyargs hyperspy --reruns 3 -n 2
pytest --pyargs hyperspy --reruns 3 -n 4

- name: Run test lumispy
- name: Run test RosettaSciIO
if: always()
shell: cmd
run: |
call "${{ env.WP_DIR_NAME }}\scripts\env.bat"
# Skip these tests until there are fixed
pytest --pyargs lumispy
pytest --pyargs rsciio --reruns 3

- name: Run test pyxem
- name: Run test hyperspy_gui_ipywidgets
if: always()
shell: cmd
run: |
call "${{ env.WP_DIR_NAME }}\scripts\env.bat"
pytest --pyargs pyxem
# test_spikes_removal_tool fails randomly, fixed in https://github.com/hyperspy/hyperspy_gui_ipywidgets/pull/51
pytest --pyargs hyperspy_gui_ipywidgets -k "not test_image_contrast_tool and not test_spikes_removal_tool"

- name: Run test kikuchipy
- name: Run test hyperspy_gui_traitsui
if: always()
shell: cmd
run: |
call "${{ env.WP_DIR_NAME }}\scripts\env.bat"
pytest --pyargs hyperspy_gui_traitsui -k "not test_image_contrast_tool"

- name: Run test exspy
if: always()
shell: cmd
run: |
call "${{ env.WP_DIR_NAME }}\scripts\env.bat"
pytest --pyargs exspy

- name: Run test holospy
if: always()
shell: cmd
run: |
call "${{ env.WP_DIR_NAME }}\scripts\env.bat"
pytest --pyargs holospy

- name: Run test lumispy
if: always()
shell: cmd
run: |
call "${{ env.WP_DIR_NAME }}\scripts\env.bat"
pytest --pyargs lumispy

- name: Run test pyxem
if: always()
shell: cmd
run: |
call "${{ env.WP_DIR_NAME }}\scripts\env.bat"
# Skip these tests until there are fixed
pytest --pyargs kikuchipy -k "not test_load_with_padding"
# cause of the TestAddEllipseArrayAsMarkers failure is unknown (seems to be on blas mkl only)
pytest --pyargs pyxem -k "not TestAddEllipseArrayAsMarkers"

# - name: Run test kikuchipy
# if: always()
# shell: cmd
# run: |
# call "${{ env.WP_DIR_NAME }}\scripts\env.bat"
# # Skip these tests until there are fixed
# pytest --pyargs kikuchipy -k "not test_load_with_padding"

- name: Upload Release Asset
if: startsWith(github.ref, 'refs/tags/')
Expand Down
12 changes: 6 additions & 6 deletions RELEASE_TEXT.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
The HyperSpy bundle is based on the [Anaconda](https://docs.anaconda.com/anaconda/) distribution and uses the `conda` or `mamba` package manager.
The HyperSpy bundle is similar to the [Miniforge](https://github.com/conda-forge/miniforge)/[Anaconda](https://docs.anaconda.com/anaconda/) distribution and uses the `conda` or `mamba` package manager.

**[Installation instructions](https://hyperspy.org/hyperspy-bundle/install.html)**

## Recommended: Anaconda-type distribution (Linux, MacOS and Windows)

For Windows and Linux, there is the choice between two variants, which are optimised for Intel or AMD CPUs:
- `Intel`: with the MKL libraries,
- `AMD`: with the openblas libraries.
- `Intel`: with the MKL library,
- `AMD`: with the openblas library.

For Mac, there are also two variants available:
- `Intel` for Mac computers with Intel CPU
- `Silicon` for Mac computers with Apple Silicon (M1, M2, etc.) CPU
- `Intel` for Mac computers with Intel CPU, with MKL library
- `Silicon` for Mac computers with Apple Silicon (M1, M2, etc.) CPU, with the Accelerate library

For included packages, [see documentation](https://hyperspy.org/hyperspy-bundle/index.html#included-software-and-libraries).

This distribution is built using [constructor 3.4.3](https://github.com/conda/constructor).
This distribution is built using [constructor 3.6.0](https://github.com/conda/constructor).

## Portable (Windows only)
The portable distribution is based on the [WinPython](https://winpython.github.io) distribution and is a self-extracting archive. Running the installer will install the distribution in the current directory. Since the distribution is portable, it can be moved to any directory or run from an external drive.
Expand Down
18 changes: 10 additions & 8 deletions conda_distribution/construct.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,21 @@ channels:
specs:
- abtem
- ase
- atomap
- conda >=23.9
#- atomap
- conda >=23.11
- dask >=2023.6.0
- dask-labextension
- exspy
- hdf5plugin
- hyperspy >=1.7.6
- hyperspyui >=1.3.1
- holospy
- hyperspy >=2.0
- hyperspyui >=2.0
- ipympl
- jupyterlab
- kikuchipy >=0.9
#- kikuchipy >=0.9
- libblas=*=*{{ blas_impl }}
- lumispy >=0.2.2
- mamba >=1.5.2
- mamba >=1.5.6
- mamba_gator
- matplotlib-scalebar
- miniforge_console_shortcut # [win]
Expand All @@ -41,14 +43,14 @@ specs:
- ovito # [win]
# - ovito =3.7 # [not win]
- particlespy
- pillow <10.1
- pillow
- py4dstem
- pymatgen
- pystackreg
- python 3.11*
- python-graphviz
- python-rapidjson
- pyxem >=0.16
- pyxem >=0.17
- openpyxl
- qtconsole >=5.4.3
- scanning_drift_corr
Expand Down
4 changes: 4 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,9 @@
"**": ["search-field.html", "sidebar-nav-bs.html", "sidebar-ethical-ads.html"]
}

linkcheck_ignore = [
"https://github.com/conda-forge/miniforge#Install", # Anchor on github.com not supported
]

def setup(app):
app.add_css_file("custom-styles.css")
2 changes: 1 addition & 1 deletion docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Linux

The process is exactly the same as
`installing Anaconda <https://docs.conda.io/projects/conda/en/latest/user-guide/install/linux.html>`_
or `Miniforge <https://github.com/conda-forge/miniforge#user-content-install>`_:
or `Miniforge <https://github.com/conda-forge/miniforge#Install>`_:

1. In your terminal window, run:

Expand Down