diff --git a/.github/workflows/build_upload_pypi_wheels.yml b/.github/workflows/build_upload_pypi_wheels.yml index c981b6ff7..9e25b1de3 100644 --- a/.github/workflows/build_upload_pypi_wheels.yml +++ b/.github/workflows/build_upload_pypi_wheels.yml @@ -14,7 +14,7 @@ jobs: include: - os: windows-latest wheelname: win - - os: macos-latest + - os: macos-12 wheelname: macos - os: ubuntu-latest wheelname: manylinux diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 59e442e9d..6cae22247 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -17,7 +17,7 @@ jobs: (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'no_ci')) strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: [ubuntu-latest, windows-latest, macos-12] fail-fast: false runs-on: ${{ matrix.os }} steps: @@ -29,7 +29,8 @@ jobs: channel-priority: true - name: Install llvm on Macos if: startsWith(matrix.os, 'macos') - run: brew install llvm + run: | + brew install llvm - name: Update pip and install dependencies shell: bash -l {0} run: | @@ -96,7 +97,7 @@ jobs: if: success() || failure() steps: - name: Download Artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: path: artifacts - name: Publish test results diff --git a/.github/workflows/test_release.yml b/.github/workflows/test_release.yml index 91456e2e8..887e7837e 100644 --- a/.github/workflows/test_release.yml +++ b/.github/workflows/test_release.yml @@ -10,7 +10,7 @@ jobs: test: strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: [ubuntu-latest, windows-latest, macos-12] fail-fast: false runs-on: ${{ matrix.os }} steps: @@ -22,7 +22,8 @@ jobs: channel-priority: true - name: Install llvm on Macos if: startsWith(matrix.os, 'macos') - run: brew install llvm + run: | + brew install llvm - name: Update pip and install dependencies shell: bash -l {0} run: | diff --git a/CHANGELOG.rst b/CHANGELOG.rst index ad44dfd77..3501bbae4 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -22,6 +22,17 @@ spglib raises TypeError when using empty unit cell and this needs handling when looking for high-symmetry labels + - Compatibility fix for Numpy 2.0 update: avoid some + broadcasting issues with array shape returned by ``np.unique`` + + - Update reference to scipy.integrate.simpson (scipy.integrate.simps + is deprecated) + + - Mac tests and builds are running against "macos-12" github runner + instead of "macos-latest", in order to test properly against + Brille. This should be restored to "macos-latest" when Brille + build system is updated and gives consistent results with + win/linux. ------------------------------------------------------------------------------- diff --git a/euphonic/force_constants.py b/euphonic/force_constants.py index b1e29a91a..252b595e2 100644 --- a/euphonic/force_constants.py +++ b/euphonic/force_constants.py @@ -508,6 +508,8 @@ def _calculate_phonons_at_qpts( norm_qpts[gamma_i] = 0. reduced_qpts, qpts_i = np.unique(norm_qpts, return_inverse=True, axis=0) + qpts_i = qpts_i.flatten() + n_rqpts = len(reduced_qpts) # Special handling of gamma points - don't reduce gamma # points if LO-TO splitting diff --git a/setup.py b/setup.py index 44e0ebabd..38ef6339c 100644 --- a/setup.py +++ b/setup.py @@ -62,7 +62,7 @@ def get_c_extension(): else: link_args = ['-fopenmp'] - compile_args = ['-fopenmp'] + compile_args = ['-fopenmp'] else: # Linux - assume gcc if CC not set diff --git a/tests_and_analysis/test/euphonic_test/test_broadening.py b/tests_and_analysis/test/euphonic_test/test_broadening.py index bc5ddd838..24eb153f9 100644 --- a/tests_and_analysis/test/euphonic_test/test_broadening.py +++ b/tests_and_analysis/test/euphonic_test/test_broadening.py @@ -3,7 +3,7 @@ from numpy.polynomial import Polynomial from numpy.random import RandomState import numpy.testing as npt -from scipy.integrate import simps +from scipy.integrate import simpson from scipy.ndimage import gaussian_filter from euphonic.broadening import (find_coeffs, @@ -74,10 +74,10 @@ def test_area_unchanged_for_broadened_dos(material, qpt_freqs_json, fit='cheby-log') ebins_centres = ebins.magnitude[:-1] + 0.5*np.diff(ebins.magnitude) assert dos.y_data.units == 1/ebins.units - dos_area = simps(dos.y_data.magnitude, ebins_centres) + dos_area = simpson(dos.y_data.magnitude, x=ebins_centres) assert variable_width_broaden.units == 1/ebins.units - adaptively_broadened_dos_area = simps(variable_width_broaden.magnitude, - ebins_centres) + adaptively_broadened_dos_area = simpson( + variable_width_broaden.magnitude, x=ebins_centres) assert adaptively_broadened_dos_area == pytest.approx(dos_area, rel=0.01)