Skip to content

Commit

Permalink
Show for RangeCumsum (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
jishnub authored Mar 22, 2024
1 parent 52d8d29 commit bca3a6b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cumsum.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,5 @@ end
function Broadcast.broadcasted(::Broadcast.DefaultArrayStyle{1}, ::typeof(*), r::RangeCumsum, x::Number)
RangeCumsum(r.range * x)
end

Base.show(io::IO, r::RangeCumsum) = print(io, RangeCumsum, "(", r.range, ")")
1 change: 1 addition & 0 deletions test/test_cumsum.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ cmpop(p) = isinteger(real(first(p))) && isinteger(real(step(p))) ? (==) : (≈)
@test diff(r) == p[firstindex(p)+1:end]
@test last(r) == r[end] == sum(p)
@test first(r) == r[firstindex(r)] == first(p)
@test repr(r) == "$RangeCumsum($p)"
end

a,b = RangeCumsum(Base.OneTo(5)), RangeCumsum(Base.OneTo(6))
Expand Down

2 comments on commit bca3a6b

@jishnub
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/103422

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 v1.8.0 -m "<description of version>" bca3a6b84420866e388660a14fc90d5aa82b8d4f
git push origin v1.8.0

Please sign in to comment.