Skip to content

Commit 9ec8020

Browse files
authored
Merge branch 'master' into patch-2
2 parents eb8dc25 + b0741da commit 9ec8020

File tree

10 files changed

+125
-21
lines changed

10 files changed

+125
-21
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,21 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
version:
13-
- '1.6'
13+
- 'lts'
1414
- '1'
15-
- '^1.11.0-0'
1615
os:
1716
- ubuntu-latest
1817
- macOS-latest
1918
- windows-latest
2019
arch:
2120
- x64
2221
steps:
23-
- uses: actions/checkout@v2
24-
- uses: julia-actions/setup-julia@v1
22+
- uses: actions/checkout@v4
23+
- uses: julia-actions/setup-julia@v2
2524
with:
2625
version: ${{ matrix.version }}
2726
arch: ${{ matrix.arch }}
28-
- uses: actions/cache@v1
27+
- uses: actions/cache@v4
2928
env:
3029
cache-name: cache-artifacts
3130
with:
@@ -38,6 +37,7 @@ jobs:
3837
- uses: julia-actions/julia-buildpkg@v1
3938
- uses: julia-actions/julia-runtest@v1
4039
- uses: julia-actions/julia-processcoverage@v1
41-
- uses: codecov/codecov-action@v1
40+
- uses: codecov/codecov-action@v4
4241
with:
42+
token: ${{ secrets.CODECOV_TOKEN }}
4343
file: lcov.info

.github/workflows/downstream.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: IntegrationTest
2+
on:
3+
push:
4+
branches: [master]
5+
tags: [v*]
6+
pull_request:
7+
paths-ignore:
8+
- 'LICENSE'
9+
- 'README.md'
10+
- '.github/workflows/TagBot.yml'
11+
12+
jobs:
13+
pre_job:
14+
# continue-on-error: true # Uncomment once integration is finished
15+
runs-on: ubuntu-latest
16+
# Map a step output to a job output
17+
outputs:
18+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
19+
steps:
20+
- id: skip_check
21+
uses: fkirc/skip-duplicate-actions@v5
22+
test:
23+
needs: pre_job
24+
if: needs.pre_job.outputs.should_skip != 'true'
25+
name: ${{ matrix.package.group }}/${{ matrix.package.repo }}/${{ matrix.julia-version }}
26+
runs-on: ${{ matrix.os }}
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
julia-version: ['1']
31+
os: [ubuntu-latest]
32+
package:
33+
- {repo: ContinuumArrays.jl, group: JuliaApproximation}
34+
- {repo: ClassicalOrthogonalPolynomials.jl, group: JuliaApproximation}
35+
36+
steps:
37+
- uses: actions/checkout@v4
38+
- uses: julia-actions/setup-julia@v2
39+
with:
40+
version: ${{ matrix.julia-version }}
41+
arch: x64
42+
- uses: julia-actions/julia-buildpkg@latest
43+
- name: Clone Downstream
44+
uses: actions/checkout@v4
45+
with:
46+
repository: ${{ matrix.package.group }}/${{ matrix.package.repo }}
47+
path: downstream
48+
- name: Load this and run the downstream tests
49+
shell: julia --color=yes --project=downstream {0}
50+
run: |
51+
using Pkg
52+
try
53+
# force it to use this PR's version of the package
54+
Pkg.develop(PackageSpec(path=".")) # resolver may fail with main deps
55+
Pkg.update()
56+
Pkg.test(; coverage = true) # resolver may fail with test time deps
57+
catch err
58+
err isa Pkg.Resolve.ResolverError || rethrow()
59+
# If we can't resolve that means this is incompatible by SemVer and this is fine
60+
# It means we marked this as a breaking change, so we don't need to worry about
61+
# Mistakenly introducing a breaking change, as we have intentionally made one
62+
@info "Not compatible with this release. No problem." exception=err
63+
exit(0) # Exit immediately, as a success
64+
end
65+
- uses: julia-actions/julia-processcoverage@v1
66+
- uses: codecov/codecov-action@v5
67+
with:
68+
token: ${{ secrets.CODECOV_TOKEN }}
69+
files: lcov.info

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "QuasiArrays"
22
uuid = "c4ea9172-b204-11e9-377d-29865faadc5c"
33
authors = ["Sheehan Olver <[email protected]>"]
4-
version = "0.11.7"
4+
version = "0.11.9"
55

66
[deps]
77
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"

src/QuasiArrays.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Base: getindex, size, axes, axes1, length, ==, isequal, iterate, Cartesia
66
isreal, iszero, isempty, empty, isapprox, fill!, getproperty, showarg
77
import Base: @_inline_meta, DimOrInd, OneTo, @_propagate_inbounds_meta, @_noinline_meta,
88
DimsInteger, error_if_canonical_getindex, @propagate_inbounds, _return_type,
9-
safe_tail, tail, _getindex, _maybe_reshape, index_ndims, _unsafe_getindex,
9+
safe_tail, front, tail, _getindex, _maybe_reshape, index_ndims, _unsafe_getindex,
1010
index_shape, to_shape, @nloops, @ncall, unalias, _unaliascopy,
1111
to_index, to_indices, _to_subscript_indices, _splatmap, dataids,
1212
compute_stride1, compute_offset1, fill_to_length
@@ -49,7 +49,9 @@ import LazyArrays: MemoryLayout, UnknownLayout, Mul, ApplyLayout, BroadcastLayou
4949
LdivStyle, InvLayout, PInvLayout, sub_materialize, lazymaterialize,
5050
_mul, rowsupport, DiagonalLayout, adjointlayout, transposelayout, conjlayout,
5151
sublayout, call, LazyArrayStyle, layout_getindex, _broadcast2broadcastarray, _applyarray_summary, _broadcastarray_summary,
52-
_broadcasted_mul, simplifiable, simplify, _mul_colsupport, _mul_rowsupport
52+
_broadcasted_mul, simplifiable, simplify, _mul_colsupport, _mul_rowsupport,
53+
_adjoint, _transpose
54+
5355
import EltypeExtensions: elconvert
5456

5557
import Base.IteratorsMD

src/calculus.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ end
3333

3434
function sum_layout(LAY::ApplyLayout{typeof(*)}, V::AbstractQuasiVector, ::Colon)
3535
a = arguments(LAY, V)
36-
first(apply(*, sum(a[1]; dims=1), tail(a)...))
36+
only(*(sum(a[1]; dims=1), tail(a)...))
37+
end
38+
39+
function sum_layout(LAY::ApplyLayout{typeof(*)}, V::AbstractQuasiMatrix, ::Colon)
40+
a = arguments(LAY, V)
41+
only(*(sum(a[1]; dims=1), front(tail(a))..., sum(a[end]; dims=2)))
3742
end
3843

3944
sum_layout(::MemoryLayout, A, dims) = sum_size(size(A), A, dims)

src/quasiadjtrans.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,14 @@ BroadcastStyle(::Type{<:QuasiTranspose{<:Any,<:Inclusion}}) = LazyQuasiArrayStyl
237237

238238

239239

240+
###
241+
# broadcast support
242+
###
243+
244+
arguments(b::BroadcastLayout, A::QuasiAdjoint) = map(_adjoint, arguments(b, parent(A)))
245+
arguments(b::BroadcastLayout, A::QuasiTranspose) = map(_transpose, arguments(b, parent(A)))
246+
247+
240248
###
241249
# adjoint concat support
242250
###

src/quasifill.jl

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -198,28 +198,31 @@ show(io::IO, F::AbstractQuasiFill) = summary(io, F)
198198

199199
function summary(io::IO, F::QuasiOnes)
200200
print(io, "ones(")
201-
summary(io, F.axes[1])
202-
for a in tail(F.axes)
203-
print(io, ", ")
204-
summary(io, a)
201+
if !isempty(F.axes)
202+
summary(io, F.axes[1])
203+
for a in tail(F.axes)
204+
print(io, ", ")
205+
summary(io, a)
206+
end
205207
end
206208
print(io, ")")
207209
end
208210

209211
function summary(io::IO, F::QuasiZeros)
210212
print(io, "zeros(")
211-
summary(io, F.axes[1])
212-
for a in tail(F.axes)
213-
print(io, ", ")
214-
summary(io, a)
213+
if !isempty(F.axes)
214+
summary(io, F.axes[1])
215+
for a in tail(F.axes)
216+
print(io, ", ")
217+
summary(io, a)
218+
end
215219
end
216220
print(io, ")")
217221
end
218222

219223
function summary(io::IO, F::QuasiFill)
220-
print(io, "fill($(F.value), ")
221-
summary(io, F.axes[1])
222-
for a in tail(F.axes)
224+
print(io, "fill($(F.value)")
225+
for a in F.axes
223226
print(io, ", ")
224227
summary(io, a)
225228
end

test/test_calculus.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ using QuasiArrays, IntervalSets, Test
1717
@test sum(ApplyQuasiArray(*, A, B)) sum(A*B)
1818
@test sum(ApplyQuasiArray(*, A, B); dims=1) sum(A*B; dims=1)
1919
@test sum(ApplyQuasiArray(*, A, B); dims=2) sum(A*B; dims=2)
20+
@test sum(ApplyQuasiArray(*, A, B)) sum(A*B)
2021

2122
@test sum(b) last(cumsum(b)) cumsum(b)[2]
2223
@test cumsum(B)[2:2,:] cumsum(B; dims=1)[2:2,:] sum(B; dims=1)

test/test_quasibroadcast.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,4 +299,12 @@ import QuasiArrays: QuasiCartesianIndex, QuasiCartesianIndices, DefaultQuasiArra
299299
A[ones(Int)] .+= 1
300300
@test A == [2,1,1,1]
301301
end
302+
303+
@testset "adjoint arguments" begin
304+
a = QuasiVector(randn(6), 0:0.5:2.5)
305+
@test LazyArrays.MemoryLayout(BroadcastQuasiArray(*, 2, a)') isa LazyArrays.BroadcastLayout
306+
@test LazyArrays.MemoryLayout(transpose(BroadcastQuasiArray(*, 2, a))) isa LazyArrays.BroadcastLayout
307+
@test LazyArrays.arguments(BroadcastQuasiArray(*, 2, a)') == (2, a')
308+
@test LazyArrays.arguments(transpose(BroadcastQuasiArray(*, 2, a))) == (2, transpose(a))
309+
end
302310
end

test/test_quasifill.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,9 +706,17 @@ import QuasiArrays: AbstractQuasiFill
706706
end
707707

708708
@testset "show" begin
709+
@test stringmime("text/plain",ones(Inclusion([1,2,3]), Inclusion([1,2,4]))) == "ones(Inclusion([1, 2, 3]), Inclusion([1, 2, 4]))"
710+
@test stringmime("text/plain",zeros(Inclusion([1,2,3]), Inclusion([1,2,4]))) == "zeros(Inclusion([1, 2, 3]), Inclusion([1, 2, 4]))"
711+
@test stringmime("text/plain",fill(2,Inclusion([1,2,3]), Inclusion([1,2,4]))) == "fill(2, Inclusion([1, 2, 3]), Inclusion([1, 2, 4]))"
712+
709713
@test stringmime("text/plain",ones(Inclusion([1,2,3]))) == "ones(Inclusion([1, 2, 3]))"
710714
@test stringmime("text/plain",zeros(Inclusion([1,2,3]))) == "zeros(Inclusion([1, 2, 3]))"
711715
@test stringmime("text/plain",fill(2,Inclusion([1,2,3]))) == "fill(2, Inclusion([1, 2, 3]))"
716+
717+
@test stringmime("text/plain",QuasiOnes()) == "ones()"
718+
@test stringmime("text/plain",QuasiZeros()) == "zeros()"
719+
@test stringmime("text/plain",QuasiFill(2)) == "fill(2)"
712720
end
713721

714722
@testset "Mul" begin

0 commit comments

Comments
 (0)