Skip to content

Commit b81c7bc

Browse files
committed
Added reshape method. Fixes #123
1 parent 9371ce3 commit b81c7bc

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ComponentArrays"
22
uuid = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
33
authors = ["Jonnie Diegelman <[email protected]>"]
4-
version = "0.11.12"
4+
version = "0.11.13"
55

66
[deps]
77
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"

src/array_interface.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Base.axes(x::ComponentArray) = CombinedAxis.(getaxes(x), axes(getdata(x)))
2020

2121
Base.reinterpret(::Type{T}, x::ComponentArray, args...) where T = ComponentArray(reinterpret(T, getdata(x), args...), getaxes(x))
2222

23+
Base.reshape(A::AbstractArray, axs::Tuple{Vararg{<:CombinedAxis}}) = reshape(A, _array_axis.(axs))
24+
2325
# Cats
2426
# TODO: Make this a little less copy-pastey
2527
function Base.hcat(x::AbstractComponentVecOrMat, y::AbstractComponentVecOrMat)

test/diffeq_test/diffeq_tests.jl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ using Test
66
using Unitful
77

88

9-
import FastBroadcast
10-
FastBroadcast.use_fast_broadcast(::Type{<:ComponentArrays.CAStyle}) = true
11-
FastBroadcast.use_fast_broadcast(::Type{<:LabelledArrays.LAStyle}) = true
12-
13-
149
@testset "Issue 31" begin
1510
function rober(vars, p, t)
1611
y₁, y₂, y₃ = vars

test/runtests.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ end
241241
# Issue #112: InvertedIndices
242242
@test ca[Not(3)] == getdata(ca)[Not(3)]
243243
@test ca[Not(2:3)] == getdata(ca)[Not(2:3)]
244+
245+
# Issue #123
246+
@test reshape(a, axes(ca)) isa Vector{Float64}
244247
end
245248

246249
@testset "Set" begin

0 commit comments

Comments
 (0)