Skip to content

Commit e239ab3

Browse files
Merge pull request #1883 from CliMA/ck/julia1p11
Fix broken Aqua test in julia 1.11
2 parents 2cd404b + 1fcae68 commit e239ab3

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

.buildkite/Manifest.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ weakdeps = ["CUDA", "MPI"]
308308
deps = ["Adapt", "BandedMatrices", "BlockArrays", "ClimaComms", "CubedSphere", "DataStructures", "DocStringExtensions", "ForwardDiff", "GaussQuadrature", "GilbertCurves", "HDF5", "InteractiveUtils", "IntervalSets", "KrylovKit", "LinearAlgebra", "MultiBroadcastFusion", "NVTX", "PkgVersion", "RecursiveArrayTools", "RootSolvers", "SparseArrays", "StaticArrays", "Statistics", "Unrolled"]
309309
path = ".."
310310
uuid = "d414da3d-4745-48bb-8d80-42e94e092884"
311-
version = "0.14.9"
311+
version = "0.14.10"
312312
weakdeps = ["CUDA", "Krylov"]
313313

314314
[deps.ClimaCore.extensions]

src/MatrixFields/band_matrix_row.jl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ subtype of `BandMatrixRow`.
4040
outer_diagonals(::Type{<:BandMatrixRow{ld, bw}}) where {ld, bw} =
4141
(ld, ld + bw - 1)
4242

43+
@inline lower_diagonal(::Tuple{<:BandMatrixRow{ld}}) where {ld} = ld
44+
@inline lower_diagonal(t::Tuple) = lower_diagonal(t...)
45+
@inline lower_diagonal(::BandMatrixRow{ld}, ::BandMatrixRow{ld}...) where {ld} =
46+
ld
47+
4348
"""
4449
band_matrix_row_type(ld, ud, T)
4550
@@ -53,8 +58,10 @@ Base.eltype(::Type{BandMatrixRow{ld, bw, T}}) where {ld, bw, T} = T
5358
Base.zero(::Type{BandMatrixRow{ld, bw, T}}) where {ld, bw, T} =
5459
BandMatrixRow{ld}(ntuple(_ -> rzero(T), Val(bw))...)
5560

56-
Base.map(f::F, rows::BandMatrixRow{ld}...) where {F, ld} =
57-
BandMatrixRow{ld}(map(f, map(row -> row.entries, rows)...)...)
61+
Base.map(f::F, rows::BandMatrixRow...) where {F} =
62+
BandMatrixRow{lower_diagonal(rows)}(
63+
map(f, map(row -> row.entries, rows)...)...,
64+
)
5865

5966
Base.@propagate_inbounds Base.getindex(row::BandMatrixRow{ld}, d) where {ld} =
6067
row.entries[d - ld + 1]

test/MatrixFields/band_matrix_row.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,11 @@ include("matrix_field_test_utils.jl")
5151
TridiagonalMatrixRow{Int},
5252
PentadiagonalMatrixRow(0, 0, 1, 0, 0),
5353
)
54+
55+
@test map(tuple, DiagonalMatrixRow(1), DiagonalMatrixRow(1.0)) ==
56+
DiagonalMatrixRow{Tuple{Int, Float64}}(((1, 1.0),))
57+
@test map(tuple, DiagonalMatrixRow(1)) == DiagonalMatrixRow(tuple(1))
58+
@test zero(typeof(DiagonalMatrixRow(1))) == DiagonalMatrixRow(0)
59+
@test eltype(typeof(DiagonalMatrixRow(1))) == Int
60+
@test inv(DiagonalMatrixRow(1)) == DiagonalMatrixRow(float(1))
5461
end

0 commit comments

Comments
 (0)