Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support plotting lazy * #177

Merged
merged 6 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@ jobs:
matrix:
version:
- '1.9'
- '1'
os:
- ubuntu-latest
- macOS-latest
- windows-latest
arch:
- x64
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
Expand All @@ -46,6 +47,8 @@ jobs:
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v4
with:
file: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ContinuumArrays"
uuid = "7ae1f121-cc2c-504b-ac30-9b923412ae5c"
version = "0.17.2"
version = "0.17.3"

[deps]
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"
Expand Down
1 change: 1 addition & 0 deletions src/bases/bases.jl
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ end


# we represent as a Mul with a banded matrix
# sublayout(::AbstractBasisLayout, ::Type{<:Tuple{<:Inclusion,<:Integer}}) = SubBasisLayout()
sublayout(::AbstractBasisLayout, ::Type{<:Tuple{<:Inclusion,<:AbstractVector}}) = SubBasisLayout()
sublayout(::AbstractBasisLayout, ::Type{<:Tuple{<:AbstractAffineQuasiVector,<:AbstractVector}}) = MappedBasisLayout()
sublayout(::WeightedBasisLayouts, ::Type{<:Tuple{<:AbstractAffineQuasiVector,<:AbstractVector}}) = MappedWeightedBasisLayout()
Expand Down
8 changes: 5 additions & 3 deletions src/plotting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@ plotgrid_layout(::SubBasisLayout, P::AbstractQuasiMatrix, n) = plotgrid(parent(P
plotgrid_layout(::SubBasisLayout, P::AbstractQuasiMatrix) = plotgrid(parent(P), maximum(parentindices(P)[2]))


_mul_plotgrid(_, args) = plotgrid_layout(UnknownLayout(), first(args))
_mul_plotgrid(::Tuple{Any,PaddedLayout}, (P,c)) = plotgrid(P, last(colsupport(c)))
_mul_plotgrid(_, args) = plotgrid(args[1], last(colsupport(ApplyArray(*, tail(args)...))))
_mul_plotgrid(_, (P,c)::NTuple{2,Any}) = plotgrid(P, last(colsupport(c)))

function plotgrid_layout(lay::ExpansionLayout, P)
function plotgrid_layout(lay::ApplyLayout{typeof(*)}, P)
args = arguments(lay,P)
_mul_plotgrid(map(MemoryLayout,args), args)
end

plotgrid_layout(::ExpansionLayout, P) = plotgrid_layout(ApplyLayout{typeof(*)}(), P)

plotvalues_size(::Tuple{InfiniteCardinal{1}}, g, x=plotgrid(g)) = g[x]
plotvalues_size(::Tuple{InfiniteCardinal{1},Int}, g, x=plotgrid(g)) = g[x,:]
plotvalues_layout(lay, g, x...) = plotvalues_size(size(g), g, x...)
Expand Down
4 changes: 4 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ include("test_basisconcat.jl")

x,v = plotgridvalues(diff(u))
@test x == [2,2,2,3,3,3,4,4,4]

@test plotgrid(diff(L)) == plotgrid(H)
@test size(plotvalues(diff(L))) == (8,5)
@test plotgrid(ApplyQuasiMatrix(*, diff(L).args..., c)) == plotgrid(H)
end

include("test_recipesbaseext.jl")
Expand Down
Loading