Skip to content

Commit

Permalink
Support plotting lazy * (#177)
Browse files Browse the repository at this point in the history
* Support plotting lazy *

* v0.17.3

* Update ci.yml

* Update ci.yml

* Update ci.yml

* add tests
  • Loading branch information
dlfivefifty authored May 7, 2024
1 parent 44933ec commit d049598
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
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

2 comments on commit d049598

@dlfivefifty
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/106343

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.17.3 -m "<description of version>" d0495982603c512c14b8380fc0f6fdfc7c47572f
git push origin v0.17.3

Please sign in to comment.