Skip to content

Commit fb363a3

Browse files
authored
Update Julia compat to 1.10 and update CI setup (#213)
* Update Julia compat to 1.10 and update CI setup * Fix architecture setting * runner only available during run * Improve CI job name * Fix comment
1 parent 592634b commit fb363a3

File tree

12 files changed

+51
-119
lines changed

12 files changed

+51
-119
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
2+
version: 2
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
directory: "/" # Location of package manifests
6+
schedule:
7+
interval: "monthly"

.github/workflows/IntegrationTest.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@ jobs:
2929

3030
steps:
3131
- uses: actions/checkout@v4
32-
- uses: julia-actions/setup-julia@v1
32+
- uses: julia-actions/setup-julia@v2
3333
with:
3434
version: ${{ matrix.julia-version }}
35-
arch: x64
3635
- uses: julia-actions/julia-buildpkg@v1
3736
- name: Clone Downstream
3837
uses: actions/checkout@v4

.github/workflows/ci.yml

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,44 @@ on:
66
pull_request:
77
jobs:
88
test:
9-
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
9+
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ (matrix.arch == '') && 'default' || matrix.arch }} - ${{ github.event_name }}
1010
runs-on: ${{ matrix.os }}
1111
strategy:
1212
fail-fast: false
1313
matrix:
1414
version:
15-
- '1.0'
16-
- '1.6'
15+
- 'min'
16+
- 'lts'
1717
- '1'
18-
- nightly
18+
- 'pre'
1919
os:
2020
- ubuntu-latest
21+
- macOS-latest # Apple Silicon
22+
- windows-latest
2123
arch:
22-
- x64
23-
- x86
24+
- ''
2425
include:
25-
- os: macOS-latest
26-
arch: x64
27-
version: 1
28-
- os: windows-latest
29-
arch: x64
26+
- os: ubuntu-latest
27+
arch: x86
3028
version: 1
3129
- os: windows-latest
3230
arch: x86
3331
version: 1
32+
- os: macOS-13 # Intel
33+
arch: ''
34+
version: 1
3435
steps:
35-
- uses: actions/checkout@v2
36-
- uses: julia-actions/setup-julia@v1
36+
- uses: actions/checkout@v4
37+
- uses: julia-actions/setup-julia@v2
3738
with:
3839
version: ${{ matrix.version }}
39-
arch: ${{ matrix.arch }}
40-
- uses: actions/cache@v1
41-
env:
42-
cache-name: cache-artifacts
43-
with:
44-
path: ~/.julia/artifacts
45-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
46-
restore-keys: |
47-
${{ runner.os }}-test-${{ env.cache-name }}-
48-
${{ runner.os }}-test-
49-
${{ runner.os }}-
40+
arch: ${{ (matrix.arch == '') && runner.arch || matrix.arch }}
41+
- uses: julia-actions/cache@v2
5042
- uses: julia-actions/julia-buildpkg@v1
5143
- uses: julia-actions/julia-runtest@v1
5244
- uses: julia-actions/julia-processcoverage@v1
53-
- uses: codecov/codecov-action@v1
45+
- uses: codecov/codecov-action@v5
5446
with:
55-
file: lcov.info
47+
files: lcov.info
48+
token: ${{ secrets.CODECOV_TOKEN }}
49+
fail_ci_if_error: true

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ BandedMatrices = "0.15, 1"
1212
Random = "<0.0.1, 1"
1313
StaticArrays = "1"
1414
Test = "<0.0.1, 1"
15-
julia = "1"
15+
julia = "1.10"
1616

1717
[extras]
1818
BandedMatrices = "aae01518-5342-5314-be14-df237901396f"

src/pdiagmat.jl

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,7 @@ function \(a::PDiagMat, x::AbstractVecOrMat)
6666
end
6767
function /(x::AbstractVecOrMat, a::PDiagMat)
6868
@check_argdims a.dim == size(x, 2)
69-
if VERSION < v"1.9-"
70-
# return matrix for 1-element vectors `x`, consistent with LinearAlgebra < 1.9
71-
return reshape(x, Val(2)) ./ permutedims(a.diag) # = (a' \ x')'
72-
else
73-
return x ./ (x isa AbstractVector ? a.diag : a.diag')
74-
end
69+
return x ./ (x isa AbstractVector ? a.diag : a.diag')
7570
end
7671
Base.kron(A::PDiagMat, B::PDiagMat) = PDiagMat(vec(permutedims(A.diag) .* B.diag))
7772

src/pdmat.jl

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,10 @@ end
7070
\(a::PDMat, x::AbstractVecOrMat) = a.chol \ x
7171
function /(x::AbstractVecOrMat, a::PDMat)
7272
# /(::AbstractVector, ::Cholesky) is not defined
73-
if VERSION < v"1.9-"
74-
# return matrix for 1-element vectors `x`, consistent with LinearAlgebra
75-
return reshape(x, Val(2)) / a.chol
73+
if x isa AbstractVector
74+
return vec(reshape(x, Val(2)) / a.chol)
7675
else
77-
if x isa AbstractVector
78-
return vec(reshape(x, Val(2)) / a.chol)
79-
else
80-
return x / a.chol
81-
end
76+
return x / a.chol
8277
end
8378
end
8479

src/pdsparsemat.jl

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -115,26 +115,14 @@ end
115115

116116
function quad(a::PDSparseMat, x::AbstractVecOrMat)
117117
@check_argdims a.dim == size(x, 1)
118-
# https://github.com/JuliaLang/julia/commit/2425ae760fb5151c5c7dd0554e87c5fc9e24de73
119-
if VERSION < v"1.4.0-DEV.92"
120-
z = a.mat * x
121-
return x isa AbstractVector ? dot(x, z) : map(dot, eachcol(x), eachcol(z))
122-
else
123-
return x isa AbstractVector ? dot(x, a.mat, x) : map(Base.Fix1(quad, a), eachcol(x))
124-
end
118+
return x isa AbstractVector ? dot(x, a.mat, x) : map(Base.Fix1(quad, a), eachcol(x))
125119
end
126120

127121
function quad!(r::AbstractArray, a::PDSparseMat, x::AbstractMatrix)
128122
@check_argdims eachindex(r) == axes(x, 2)
129123
@inbounds for i in axes(x, 2)
130124
xi = view(x, :, i)
131-
# https://github.com/JuliaLang/julia/commit/2425ae760fb5151c5c7dd0554e87c5fc9e24de73
132-
if VERSION < v"1.4.0-DEV.92"
133-
# Can't use `lmul!` with buffer due to missing support in SparseArrays
134-
r[i] = dot(xi, a.mat * xi)
135-
else
136-
r[i] = dot(xi, a.mat, xi)
137-
end
125+
r[i] = dot(xi, a.mat, xi)
138126
end
139127
return r
140128
end

src/scalmat.jl

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,7 @@ function \(a::ScalMat, x::AbstractVecOrMat)
5454
end
5555
function /(x::AbstractVecOrMat, a::ScalMat)
5656
@check_argdims a.dim == size(x, 2)
57-
if VERSION < v"1.9-"
58-
# return matrix for 1-element vectors `x`, consistent with LinearAlgebra < 1.9
59-
return reshape(x, Val(2)) / a.value
60-
else
61-
return x / a.value
62-
end
57+
return x / a.value
6358
end
6459
Base.kron(A::ScalMat, B::ScalMat) = ScalMat(A.dim * B.dim, A.value * B.value )
6560

@@ -78,7 +73,7 @@ LinearAlgebra.sqrt(a::ScalMat) = ScalMat(a.dim, sqrt(a.value))
7873
function whiten!(r::AbstractVecOrMat, a::ScalMat, x::AbstractVecOrMat)
7974
@check_argdims axes(r) == axes(x)
8075
@check_argdims a.dim == size(x, 1)
81-
_ldiv!(r, sqrt(a.value), x)
76+
ldiv!(r, sqrt(a.value), x)
8277
end
8378

8479
function unwhiten!(r::AbstractVecOrMat, a::ScalMat, x::AbstractVecOrMat)
@@ -180,10 +175,10 @@ end
180175

181176
function X_invA_Xt(a::ScalMat, x::Matrix{<:Real})
182177
@check_argdims LinearAlgebra.checksquare(a) == size(x, 2)
183-
return Symmetric(_rdiv!(x * transpose(x), a.value))
178+
return Symmetric(rdiv!(x * transpose(x), a.value))
184179
end
185180

186181
function Xt_invA_X(a::ScalMat, x::Matrix{<:Real})
187182
@check_argdims LinearAlgebra.checksquare(a) == size(x, 1)
188-
return Symmetric(_rdiv!(transpose(x) * x, a.value))
183+
return Symmetric(rdiv!(transpose(x) * x, a.value))
189184
end

src/utils.jl

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -103,29 +103,3 @@ function colwise_sumsqinv!(r::AbstractArray, a::AbstractMatrix, c::Real)
103103
end
104104
return r
105105
end
106-
107-
# `rdiv!(::AbstractArray, ::Number)` was introduced in Julia 1.2
108-
# https://github.com/JuliaLang/julia/pull/31179
109-
@static if VERSION < v"1.2.0-DEV.385"
110-
function _rdiv!(X::AbstractArray, s::Number)
111-
@simd for I in eachindex(X)
112-
@inbounds X[I] /= s
113-
end
114-
X
115-
end
116-
else
117-
_rdiv!(X::AbstractArray, s::Number) = rdiv!(X, s)
118-
end
119-
120-
# `ldiv!(::AbstractArray, ::Number, ::AbstractArray)` was introduced in Julia 1.4
121-
# https://github.com/JuliaLang/julia/pull/33806
122-
@static if VERSION < v"1.4.0-DEV.635"
123-
_ldiv!(Y::AbstractArray, s::Number, X::AbstractArray) = Y .= s .\ X
124-
else
125-
_ldiv!(Y::AbstractArray, s::Number, X::AbstractArray) = ldiv!(Y, s, X)
126-
end
127-
128-
# https://github.com/JuliaLang/julia/pull/29749
129-
if VERSION < v"1.1.0-DEV.792"
130-
eachcol(A::AbstractVecOrMat) = (view(A, :, i) for i in axes(A, 2))
131-
end

test/pdmtypes.jl

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,10 @@ using Test
134134
@test z y
135135
end
136136

137-
# requires https://github.com/JuliaLang/julia/pull/32594
138-
if VERSION >= v"1.3.0-DEV.562"
139-
z = x / PDMat(A)
140-
@test typeof(z) === typeof(y)
141-
@test size(z) == size(y)
142-
@test z y
143-
end
137+
z = x / PDMat(A)
138+
@test typeof(z) === typeof(y)
139+
@test size(z) == size(y)
140+
@test z y
144141

145142
# right division not defined for CHOLMOD:
146143
# `rdiv!(::Matrix{Float64}, ::SuiteSparse.CHOLMOD.Factor{Float64})` not defined
@@ -154,14 +151,11 @@ using Test
154151

155152
@testset "PDMat from Cholesky decomposition of diagonal matrix (#137)" begin
156153
# U'*U where U isa UpperTriangular etc.
157-
# requires https://github.com/JuliaLang/julia/pull/33334
158-
if VERSION >= v"1.4.0-DEV.286"
159-
x = rand(10, 10)
160-
A = Diagonal(x' * x)
161-
M = PDMat(cholesky(A))
162-
@test M isa PDMat{Float64, typeof(A)}
163-
@test Matrix(M) A
164-
end
154+
x = rand(10, 10)
155+
A = Diagonal(x' * x)
156+
M = PDMat(cholesky(A))
157+
@test M isa PDMat{Float64, typeof(A)}
158+
@test Matrix(M) A
165159
end
166160

167161
@testset "AbstractPDMat constructors (#136)" begin
@@ -204,12 +198,7 @@ using Test
204198
@test Mat32 isa Matrix{Float32}
205199
@test Mat32 Float32.(A)
206200

207-
if VERSION < v"1.6"
208-
# inference fails e.g. on Julia 1.0
209-
M = AbstractPDMat(cholesky(sparse(A)))
210-
else
211-
M = @inferred AbstractPDMat(cholesky(sparse(A)))
212-
end
201+
M = @inferred AbstractPDMat(cholesky(sparse(A)))
213202
@test M isa PDSparseMat
214203
@test Matrix(M) A
215204
end

0 commit comments

Comments
 (0)