Skip to content

Commit 91c88bb

Browse files
authored
FillArrays v1 (#251)
* FillArrays v1 * Update Project.toml * tests pass * Update blockbroadcast.jl * fix tests on 1.6
1 parent 35f456d commit 91c88bb

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

Project.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
name = "BlockArrays"
22
uuid = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
3-
version = "0.16.25"
3+
version = "0.16.26"
44

55
[deps]
66
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
77
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
88
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
99

1010
[compat]
11-
Aqua = "0.5"
12-
ArrayLayouts = "0.8.1"
13-
FillArrays = "0.13.2"
11+
Aqua = "0.5, 0.6"
12+
ArrayLayouts = "1"
13+
FillArrays = "1"
1414
julia = "1.6"
1515

1616
[extras]

src/blockbroadcast.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,14 +286,14 @@ BroadcastStyle(::Type{<:SubArray{<:Any,N,<:PseudoBlockArray,I}}) where {N,I<:Tup
286286

287287
for op in (:*, :/)
288288
@eval begin
289-
broadcasted(::AbstractBlockStyle, ::typeof($op), a::Zeros, b::AbstractArray) = FillArrays._broadcasted_zeros(a, b)
289+
broadcasted(::AbstractBlockStyle, ::typeof($op), a::Zeros, b::AbstractArray) = FillArrays._broadcasted_zeros($op, a, b)
290290
broadcasted(::AbstractBlockStyle, ::typeof($op), a::Ones{T}, b::AbstractArray{V}) where {T,V} = LinearAlgebra.copy_oftype(b, Base.promote_op(*, T, V))
291291
end
292292
end
293293

294294
for op in (:*, :\)
295295
@eval begin
296-
broadcasted(::AbstractBlockStyle, ::typeof($op), a::AbstractArray, b::Zeros) = FillArrays._broadcasted_zeros(a, b)
296+
broadcasted(::AbstractBlockStyle, ::typeof($op), a::AbstractArray, b::Zeros) = FillArrays._broadcasted_zeros($op, a, b)
297297
broadcasted(::AbstractBlockStyle, ::typeof($op), a::AbstractArray{T}, b::Ones{V}) where {T,V} = LinearAlgebra.copy_oftype(a, Base.promote_op(*, T, V))
298298
end
299299
end

test/test_blockarrayinterface.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,9 @@ end
138138

139139
@testset "non-standard block axes" begin
140140
A = BlockArray([1 2; 3 4], Fill(1, 2), Fill(1, 2))
141-
@test A isa BlockMatrix{Int,Matrix{Matrix{Int}},NTuple{2,BlockedUnitRange{StepRange{Int,Int}}}}
141+
@test A isa BlockMatrix{Int,Matrix{Matrix{Int}},<:NTuple{2,BlockedUnitRange{<:AbstractRange}}}
142142
A = BlockArray([1 2; 3 4], Fill(1, 2), [1, 1])
143-
@test A isa BlockMatrix{Int,Matrix{Matrix{Int}},Tuple{BlockedUnitRange{StepRange{Int,Int}},BlockedUnitRange{Vector{Int}}}}
143+
@test A isa BlockMatrix{Int,Matrix{Matrix{Int}},<:Tuple{BlockedUnitRange{<:AbstractRange},BlockedUnitRange{Vector{Int}}}}
144144
end
145145

146146
@testset "block Fill" begin

test/test_blockindices.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using BlockArrays, FillArrays, OffsetArrays, Test, Base64, StaticArrays, ArrayLayouts
1+
using BlockArrays, FillArrays, Test, Base64, StaticArrays, ArrayLayouts
2+
using OffsetArrays
23
import BlockArrays: BlockIndex, BlockIndexRange, BlockSlice
34

45
@testset "Blocks" begin
@@ -148,7 +149,7 @@ end
148149
@test_throws BlockBoundsError b[Block(2)]
149150

150151
b = blockedrange(Fill(3,1_000_000))
151-
@test b isa BlockedUnitRange{StepRange{Int,Int}}
152+
@test b isa BlockedUnitRange{<:AbstractRange}
152153
@test b[Block(100_000)] == 299_998:300_000
153154
@test_throws BlockBoundsError b[Block(0)]
154155
@test_throws BlockBoundsError b[Block(1_000_001)]
@@ -166,7 +167,7 @@ end
166167

167168
f = blockedrange(Fill(2,5))
168169
@test blockfirsts(f) 1:2:9
169-
@test blocklasts(f) 2:2:10
170+
@test blocklasts(f) StepRangeLen(2,2,5)
170171
@test blocklengths(f) Fill(2,5)
171172

172173
r = blockedrange(Base.OneTo(5))

0 commit comments

Comments
 (0)