From c4e81524bf2d1dbdc1f39bbbc23da2d91fc8b600 Mon Sep 17 00:00:00 2001 From: Sheehan Olver Date: Sat, 10 Aug 2024 08:44:40 +0100 Subject: [PATCH 1/7] Update ci.yml --- .github/workflows/ci.yml | 59 +++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ed99e8e..e2124e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,56 +1,59 @@ name: CI -env: - JULIA_NUM_THREADS: 2 on: - pull_request: push: branches: - master - tags: '*' - merge_group: + tags: [v*] + paths-ignore: + - 'LICENSE' + - 'README.md' + - '.github/workflows/TagBot.yml' + pull_request: + paths-ignore: + - 'LICENSE' + - 'README.md' + - '.github/workflows/TagBot.yml' + + +concurrency: + group: build-${{ github.event.pull_request.number || github.ref }}-${{ github.workflow }} + cancel-in-progress: true + jobs: - finalize: - timeout-minutes: 10 - needs: [test] - if: always() + pre_job: + # continue-on-error: true # Uncomment once integration is finished runs-on: ubuntu-latest + # Map a step output to a job output + outputs: + should_skip: ${{ steps.skip_check.outputs.should_skip }} steps: - - run: | - echo test: ${{ needs.test.result }} - - run: exit 1 - if: | - (needs.test.result != 'success') + - id: skip_check + uses: fkirc/skip-duplicate-actions@v5 test: + needs: pre_job + if: needs.pre_job.outputs.should_skip != 'true' name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: version: - - 'nightly' + - 'lts' - '1' + - 'nightly' os: - ubuntu-latest -# - macos-latest -# - windows-latest + - macOS-latest + - windows-latest arch: - x64 steps: - uses: actions/checkout@v4 - - uses: julia-actions/setup-julia@v1 + - uses: julia-actions/setup-julia@v2.2 with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - - uses: actions/cache@v4 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- + - uses: julia-actions/cache@v2 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 - uses: julia-actions/julia-processcoverage@v1 From 1cfe5cdb7d702db23e46f1ca3882e7104547bbed Mon Sep 17 00:00:00 2001 From: Sheehan Olver Date: Sat, 10 Aug 2024 08:44:57 +0100 Subject: [PATCH 2/7] Update .gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c10b7b2..1699e29 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ Manifest.toml docs/build/ -.github/.DS_Store +.DS_Store From 137719d8f01cb44994df295159834e7828c3378b Mon Sep 17 00:00:00 2001 From: Sheehan Olver Date: Sat, 10 Aug 2024 08:51:46 +0100 Subject: [PATCH 3/7] Use old matrix notation for Julia v1.6 support --- test/eigenselfadjoint.jl | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/test/eigenselfadjoint.jl b/test/eigenselfadjoint.jl index a5a7508..e5209e8 100644 --- a/test/eigenselfadjoint.jl +++ b/test/eigenselfadjoint.jl @@ -121,22 +121,10 @@ Base.isreal(q::Quaternion) = q.v1 == q.v2 == q.v3 == 0 @testset "issue 123" begin M = Hermitian([ - big"-0.4080898675832881399369478084264191594976530854542904557798567397269356887436951"; - big"-0.1032324294981949906363774065395184125237581835226155628209100984396171211818558"; - big"-1.0795157507124452910839896877334667387210301781514938067860918240771876343947"; - big"0.9172086645212876240254394768180975107502376572771647296150618931226550446699544";; - big"-0.1032324294981949906363774065395184125237581835226155628209100984396171211818558"; - big"-0.9819956883377066621250198846550622559246996804965712336465013506629992739010227"; - big"0.1882735697944729855991976669864503854920622386133987141371224931350749728226066"; - big"-0.1599663084136352437739757607131301560774255778371317602542426234968564801904052";; - big"-1.0795157507124452910839896877334667387210301781514938067860918240771876343947"; - big"0.1882735697944729855991976669864503854920622386133987141371224931350749728226066"; - big"0.9688026817149176598146701814747478080649943014810992426739997593840858865727305"; - big"-1.672789745967021000172452940954243617442140494364475046869527486458478435262502";; - big"0.9172086645212876240254394768180975107502376572771647296150618931226550446699544"; - big"-0.1599663084136352437739757607131301560774255778371317602542426234968564801904052"; - big"-1.672789745967021000172452940954243617442140494364475046869527486458478435262502"; - big"0.4212828742060771422472975116067336073573584644697624467523583310058490760719874" + big"-0.4080898675832881399369478084264191594976530854542904557798567397269356887436951" big"-0.1032324294981949906363774065395184125237581835226155628209100984396171211818558" big"-1.0795157507124452910839896877334667387210301781514938067860918240771876343947" big"0.9172086645212876240254394768180975107502376572771647296150618931226550446699544"; + big"-0.1032324294981949906363774065395184125237581835226155628209100984396171211818558" big"-0.9819956883377066621250198846550622559246996804965712336465013506629992739010227" big"0.1882735697944729855991976669864503854920622386133987141371224931350749728226066" big"-0.1599663084136352437739757607131301560774255778371317602542426234968564801904052"; + big"-1.0795157507124452910839896877334667387210301781514938067860918240771876343947" big"0.1882735697944729855991976669864503854920622386133987141371224931350749728226066" big"0.9688026817149176598146701814747478080649943014810992426739997593840858865727305" big"-1.672789745967021000172452940954243617442140494364475046869527486458478435262502"; + big"0.9172086645212876240254394768180975107502376572771647296150618931226550446699544" big"-0.1599663084136352437739757607131301560774255778371317602542426234968564801904052" big"-1.672789745967021000172452940954243617442140494364475046869527486458478435262502" big"0.4212828742060771422472975116067336073573584644697624467523583310058490760719874" ]) F = eigen(M) @test M * F.vectors ≈ F.vectors * Diagonal(F.values) From 737ef1833734ab26377d4811bf51c3aea29b541d Mon Sep 17 00:00:00 2001 From: Sheehan Olver Date: Sat, 10 Aug 2024 08:52:29 +0100 Subject: [PATCH 4/7] remove no longter needed type piracy --- test/eigenselfadjoint.jl | 1 - 1 file changed, 1 deletion(-) diff --git a/test/eigenselfadjoint.jl b/test/eigenselfadjoint.jl index e5209e8..e1127fa 100644 --- a/test/eigenselfadjoint.jl +++ b/test/eigenselfadjoint.jl @@ -1,5 +1,4 @@ using Test, GenericLinearAlgebra, LinearAlgebra, Quaternions -Base.isreal(q::Quaternion) = q.v1 == q.v2 == q.v3 == 0 @testset "The selfadjoint eigen problem" begin n = 50 From e2c85d4911b89dff0263e0cf5af36b64e778817c Mon Sep 17 00:00:00 2001 From: Sheehan Olver Date: Sat, 10 Aug 2024 09:17:39 +0100 Subject: [PATCH 5/7] Fix tests on Julia v1.6 --- src/eigenGeneral.jl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/eigenGeneral.jl b/src/eigenGeneral.jl index d858e38..893800b 100644 --- a/src/eigenGeneral.jl +++ b/src/eigenGeneral.jl @@ -29,6 +29,14 @@ function LinearAlgebra.ldiv!(H::HessenbergMatrix, B::AbstractVecOrMat) end (\)(H::HessenbergMatrix, B::AbstractVecOrMat) = ldiv!(copy(H), copy(B)) +if VERSION < v"1.10" + # ensure tests pass on Julia v1.6 + copy_similar(A::AbstractArray, ::Type{T}) where {T} = copyto!(similar(A, T, size(A)), A) + eigtype(T) = promote_type(Float32, typeof(zero(T)/sqrt(abs2(one(T))))) + eigencopy_oftype(A, S) = copy_similar(A, S) + LinearAlgebra.eigvals(A::HessenbergMatrix{T}; kws...) where T = LinearAlgebra.eigvals!(eigencopy_oftype(A, eigtype(T)); kws...) +end + # Hessenberg factorization struct HessenbergFactorization{T,S<:StridedMatrix,U} <: Factorization{T} data::S From db0880ae9a50968367cd1e62fdf9aa7fa8735d33 Mon Sep 17 00:00:00 2001 From: Sheehan Olver Date: Sat, 10 Aug 2024 10:10:37 +0100 Subject: [PATCH 6/7] restore CI --- .github/workflows/ci.yml | 56 +++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e2124e6..ae5fd97 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,37 +1,26 @@ name: CI +env: + JULIA_NUM_THREADS: 2 on: + pull_request: push: branches: - master - tags: [v*] - paths-ignore: - - 'LICENSE' - - 'README.md' - - '.github/workflows/TagBot.yml' - pull_request: - paths-ignore: - - 'LICENSE' - - 'README.md' - - '.github/workflows/TagBot.yml' - - -concurrency: - group: build-${{ github.event.pull_request.number || github.ref }}-${{ github.workflow }} - cancel-in-progress: true - + tags: '*' + merge_group: jobs: - pre_job: - # continue-on-error: true # Uncomment once integration is finished + finalize: + timeout-minutes: 10 + needs: [test] + if: always() runs-on: ubuntu-latest - # Map a step output to a job output - outputs: - should_skip: ${{ steps.skip_check.outputs.should_skip }} steps: - - id: skip_check - uses: fkirc/skip-duplicate-actions@v5 + - run: | + echo test: ${{ needs.test.result }} + - run: exit 1 + if: | + (needs.test.result != 'success') test: - needs: pre_job - if: needs.pre_job.outputs.should_skip != 'true' name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} runs-on: ${{ matrix.os }} strategy: @@ -39,12 +28,12 @@ jobs: matrix: version: - 'lts' - - '1' - 'nightly' + - '1' os: - ubuntu-latest - - macOS-latest - - windows-latest +# - macos-latest +# - windows-latest arch: - x64 steps: @@ -53,7 +42,16 @@ jobs: with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - - uses: julia-actions/cache@v2 + - uses: actions/cache@v4 + env: + cache-name: cache-artifacts + with: + path: ~/.julia/artifacts + key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} + restore-keys: | + ${{ runner.os }}-test-${{ env.cache-name }}- + ${{ runner.os }}-test- + ${{ runner.os }}- - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 - uses: julia-actions/julia-processcoverage@v1 From 60a1a9ad6e886e681e0e3803be8742617260e1ea Mon Sep 17 00:00:00 2001 From: Sheehan Olver Date: Sat, 10 Aug 2024 10:12:41 +0100 Subject: [PATCH 7/7] Update eigenselfadjoint.jl --- test/eigenselfadjoint.jl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/eigenselfadjoint.jl b/test/eigenselfadjoint.jl index 7204c1b..e6f6c4f 100644 --- a/test/eigenselfadjoint.jl +++ b/test/eigenselfadjoint.jl @@ -148,9 +148,12 @@ using Test, GenericLinearAlgebra, LinearAlgebra, Quaternions @testset "#133" begin A = SymTridiagonal{BigFloat}(randn(5), randn(4)) T = Tridiagonal(A) - @test eigvals(A) == eigvals(T) == eigvals(A; sortby=LinearAlgebra.eigsortby) == eigvals(T; sortby=LinearAlgebra.eigsortby) == eigvals!(deepcopy(A); sortby=LinearAlgebra.eigsortby) - @test eigen(A).values == eigen(T).values == eigen(A; sortby=LinearAlgebra.eigsortby).values == eigen(T; sortby=LinearAlgebra.eigsortby).values - # compare abs to avoid sign issues - @test abs.(eigen(A).vectors) == abs.(eigen(T).vectors) == abs.(eigen(A; sortby=LinearAlgebra.eigsortby).vectors) == abs.(eigen(T; sortby=LinearAlgebra.eigsortby).vectors) + if VERSION ≥ v"1.10" + # The following depends on more recent behaviour of eigvals/eigen in stdlib + @test eigvals(A) == eigvals(T) == eigvals(A; sortby=LinearAlgebra.eigsortby) == eigvals(T; sortby=LinearAlgebra.eigsortby) == eigvals!(deepcopy(A); sortby=LinearAlgebra.eigsortby) + @test eigen(A).values == eigen(T).values == eigen(A; sortby=LinearAlgebra.eigsortby).values == eigen(T; sortby=LinearAlgebra.eigsortby).values + # compare abs to avoid sign issues + @test abs.(eigen(A).vectors) == abs.(eigen(T).vectors) == abs.(eigen(A; sortby=LinearAlgebra.eigsortby).vectors) == abs.(eigen(T; sortby=LinearAlgebra.eigsortby).vectors) + end end end