Skip to content

Commit 48329f5

Browse files
Merge pull request #39 from JuliaDiffEq/myb/fix
Fix the printing for Array of ArrayPartition
2 parents d21cf75 + 136a0b1 commit 48329f5

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/array_partition.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ Base.last(A::ArrayPartition) = last(last(A.x))
227227

228228
## display
229229
Base.summary(A::ArrayPartition) = string(typeof(A), " with arrays:")
230-
Base.show(io::IO,A::ArrayPartition) = Base.show.(io,A.x)
230+
Base.show(io::IO,A::ArrayPartition) = map(x->Base.show(io,x),A.x)
231231
Base.show(io::IO, m::MIME"text/plain", A::ArrayPartition) = show(io, m, A.x)
232232

233233
## broadcasting

test/utils_test.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ AofuSA = [@SVector [2.0u"kg",3.0u"kg"] for i in 1:5]
2727
recursive_unitless_eltype(AofuSA) == SVector{2,Float64}
2828

2929
@inferred recursive_unitless_eltype(AofuSA)
30+
31+
A = [ArrayPartition(ones(1),ones(1)),]
32+
@test repr("text/plain", A) == "1-element Array{ArrayPartition{Float64,Tuple{Array{Float64,1},Array{Float64,1}}},1}:\n [1.0][1.0]"

0 commit comments

Comments
 (0)