Skip to content

Commit bae4e88

Browse files
committed
Merge branch 'master' into lazyarrays-ext-load-failure
2 parents ab1261a + cc46573 commit bae4e88

File tree

10 files changed

+30
-25
lines changed

10 files changed

+30
-25
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
test:
3131
needs: pre_job
3232
if: needs.pre_job.outputs.should_skip != 'true'
33-
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
33+
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ github.event_name }}
3434
runs-on: ${{ matrix.os }}
3535
strategy:
3636
fail-fast: false
@@ -42,14 +42,11 @@ jobs:
4242
- ubuntu-latest
4343
- macOS-latest
4444
- windows-latest
45-
arch:
46-
- x64
4745
steps:
4846
- uses: actions/checkout@v4
4947
- uses: julia-actions/setup-julia@v2
5048
with:
5149
version: ${{ matrix.version }}
52-
arch: ${{ matrix.arch }}
5350
- uses: actions/cache@v4
5451
env:
5552
cache-name: cache-artifacts
@@ -66,4 +63,4 @@ jobs:
6663
- uses: codecov/codecov-action@v5
6764
with:
6865
token: ${{ secrets.CODECOV_TOKEN }}
69-
file: lcov.info
66+
files: lcov.info

.github/workflows/downstream.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- {repo: ApproxFunBase.jl, group: JuliaApproximation}
3939
- {repo: LazyArrays.jl, group: JuliaArrays}
4040
- {repo: LazyBandedMatrices.jl, group: JuliaLinearAlgebra}
41-
# - {repo: InfiniteLinearAlgebra.jl, group: JuliaLinearAlgebra}
41+
- {repo: InfiniteLinearAlgebra.jl, group: JuliaLinearAlgebra}
4242

4343
steps:
4444
- uses: actions/checkout@v4
@@ -60,7 +60,7 @@ jobs:
6060
# force it to use this PR's version of the package
6161
Pkg.develop(PackageSpec(path=".")) # resolver may fail with main deps
6262
Pkg.update()
63-
Pkg.test() # resolver may fail with test time deps
63+
Pkg.test(test_args=["--downstream_integration_test"]) # resolver may fail with test time deps
6464
catch err
6565
err isa Pkg.Resolve.ResolverError || rethrow()
6666
# If we can't resolve that means this is incompatible by SemVer and this is fine

Project.toml

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

55
[deps]
66
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
@@ -21,13 +21,13 @@ BandedMatrices = "1.0"
2121
Documenter = "1.0"
2222
FillArrays = "1.11"
2323
Images = "0.26"
24-
LinearAlgebra = "1.6"
24+
LinearAlgebra = "1"
2525
OffsetArrays = "1.0"
26-
Random = "1.6"
27-
SparseArrays = "1.6"
28-
StaticArrays = "1.6"
29-
Test = "1.6"
30-
julia = "1.6"
26+
Random = "1"
27+
SparseArrays = "1"
28+
StaticArrays = "1"
29+
Test = "1"
30+
julia = "1.10"
3131

3232
[extras]
3333
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"

src/BlockArrays.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,4 @@ include("blockbanded.jl")
7878
@deprecate getblock!(X, A::AbstractBlockArray{T,N}, I::Vararg{Integer, N}) where {T,N} copyto!(X, view(A, Block(I)))
7979
@deprecate setblock!(A::AbstractBlockArray{T,N}, v, I::Vararg{Integer, N}) where {T,N} (A[Block(I...)] = v)
8080

81-
if !isdefined(Base, :get_extension)
82-
include("../ext/BlockArraysBandedMatricesExt.jl")
83-
end
84-
8581
end # module

src/blockindices.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,10 @@ last(b::Block) = b
5252
iterate(x::Block) = (x, nothing)
5353
iterate(x::Block, ::Any) = nothing
5454
isempty(x::Block) = false
55-
broadcastable(x::Block) = x
55+
broadcastable(x::Block) = Ref(x)
5656
ndims(::Type{<:Block}) = 0
5757
ndims(::Block) = 0
5858
eltype(::Type{B}) where B<:Block = B
59-
getindex(B::Block, ::CartesianIndex{0}) = B
6059

6160
# The following code is taken from CartesianIndex
6261
@inline (+)(index::Block{N}) where {N} = Block{N}(map(+, index.n))
@@ -147,10 +146,12 @@ struct BlockIndex{N,TI<:Tuple{Vararg{Integer,N}},Tα<:Tuple{Vararg{Integer,N}}}
147146
end
148147

149148
@inline BlockIndex(a::NTuple{N,Block{1}}, b::Tuple) where N = BlockIndex(Int.(a), b)
149+
@inline BlockIndex(::Tuple{}, b::Tuple{}) = BlockIndex{0,Tuple{},Tuple{}}((), ())
150150

151151
@inline BlockIndex(a::Integer, b::Integer) = BlockIndex((a,), (b,))
152152
@inline BlockIndex(a::Tuple, b::Integer) = BlockIndex(a, (b,))
153153
@inline BlockIndex(a::Integer, b::Tuple) = BlockIndex((a,), b)
154+
@inline BlockIndex() = BlockIndex((), ())
154155

155156
@inline BlockIndex(a::Block, b::Tuple) = BlockIndex(a.n, b)
156157
@inline BlockIndex(a::Block, b::Integer) = BlockIndex(a, (b,))
@@ -202,7 +203,7 @@ BlockIndexRange(block::Block{N}, inds::Vararg{AbstractUnitRange{<:Integer},N}) w
202203

203204
block(R::BlockIndexRange) = R.block
204205

205-
getindex(::Block{0}) = Block()
206+
getindex(::Block{0}) = BlockIndex()
206207
getindex(B::Block{N}, inds::Vararg{Integer,N}) where N = BlockIndex(B,inds)
207208
getindex(B::Block{N}, inds::Vararg{AbstractUnitRange{<:Integer},N}) where N = BlockIndexRange(B,inds)
208209
getindex(B::Block{1}, inds::Colon) = B

src/blocks.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ julia> blocksizes(A,2)
125125
```
126126
"""
127127
blocksizes(A::AbstractArray) = BlockSizes(A)
128-
blocksizes(A::AbstractArray, d::Integer) = blocklengths(axes(A, d))
128+
@inline blocksizes(A::AbstractArray, d::Integer) = blocklengths(axes(A, d))
129129

130130
struct BlockSizes{T,N,A<:AbstractArray{<:Any,N}} <: AbstractArray{T,N}
131131
array::A

test/runtests.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
using BlockArrays, LinearAlgebra, Test
22

33
using Aqua
4+
downstream_test = "--downstream_integration_test" in ARGS
45
@testset "Project quality" begin
5-
Aqua.test_all(BlockArrays, ambiguities=false)
6+
Aqua.test_all(BlockArrays, ambiguities=false,
7+
stale_deps=!downstream_test)
68
end
79

810
using Documenter

test/test_blockarrays.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ end
333333
@test size(ret) == ()
334334
@test all(iszero, ret)
335335
@test ret[Block()] == zeros()
336-
@test ret[Block()[]] == zeros()
336+
@test ret[Block()[]] == 0
337337
@test ret[] == 0
338338
@test view(ret, Block()) == zeros()
339339
@test Array(ret) == zeros()
@@ -360,7 +360,7 @@ end
360360
@test all(iszero, ret)
361361
@test ret[] == 0
362362
@test ret[Block()] == zeros()
363-
@test ret[Block()[]] == zeros()
363+
@test ret[Block()[]] == 0
364364
@test Array(ret) == zeros()
365365
ret[] = 1
366366
@test ret[] == 1

test/test_blockindices.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ import BlockArrays: BlockIndex, BlockIndexRange, BlockSlice
8484
end
8585

8686
@testset "BlockIndex" begin
87+
@test Block()[] == BlockIndex()
8788
@test Block(1)[1] == BlockIndex((1,),(1,))
8889
@test Block(1)[1:2] == BlockIndexRange(Block(1),(1:2,))
8990
@test Block(1,1)[1,1] == BlockIndex((1,1),(1,1)) == BlockIndex((1,1),(1,))

test/test_blocks.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,14 @@ end
127127
@test blocksizes(A, 1) == [2, 3]
128128
@test blocksizes(A, 2) == [3, 1]
129129
end
130+
131+
@testset "Inference: issue #425" begin
132+
x = BlockedArray(rand(4, 4), [2, 2], [2, 2])
133+
bs1 = @inferred (x -> blocksizes(x, 1))(x)
134+
@test bs1 == [2,2]
135+
bs4 = @inferred (x -> blocksizes(x, 4))(x)
136+
@test bs4 == 1:1
137+
end
130138
end
131139

132140
end # module

0 commit comments

Comments
 (0)