Skip to content

Commit

Permalink
Define fill! for PencilArrays (#22)
Browse files Browse the repository at this point in the history
* Define fill! for PencilArray

* Bump version

* Add test
  • Loading branch information
jipolanco authored Mar 18, 2021
1 parent 0979c16 commit 690f742
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PencilArrays"
uuid = "0e08944d-e94e-41b1-9406-dcf66b6a9d2e"
authors = ["Juan Ignacio Polanco <[email protected]> and contributors"]
version = "0.9.1"
version = "0.9.2"

[deps]
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
Expand Down
2 changes: 2 additions & 0 deletions src/arrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -455,3 +455,5 @@ permutation(x::PencilArrayCollection) = _apply(permutation, x)
Get [`MPITopology`](@ref) associated to a `PencilArray`.
"""
topology(x::MaybePencilArrayCollection) = topology(pencil(x))

Base.fill!(A::PencilArray, x) = fill!(parent(A), x)
5 changes: 5 additions & 0 deletions test/pencils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ function test_array_wrappers(p::Pencil, ::Type{T} = Float64) where {T}

@test match(r"PencilArray{.*}\(::Pencil{.*}\)", summary(u)) !== nothing

for x in (42, 10)
fill!(u, x)
@test all(==(x), u)
end

perm = permutation(u)
@test perm === permutation(typeof(u))
let topo = topology(p)
Expand Down

2 comments on commit 690f742

@jipolanco
Copy link
Owner 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/32301

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.9.2 -m "<description of version>" 690f742ed5d01e9bc077eda563eeccf7ee49446f
git push origin v0.9.2

Please sign in to comment.